input: Write a python function to build and train an SVM model to predict gender based on height and weight.
  assert build_and_train_svm([[1.78, 80, "male"], [1.69, 55, "female"], [1.68, 65, "female"], [1.68, 70, "male"], [1.73, 68, "female"]], [[1.78, 80]]) == ["male"]
  assert build_and_train_svm([[1.70, 75, "male"], [1.60, 50, "female"], [1.65, 60, "female"], [1.75, 70, "male"], [1.68, 65, "female"]], [[1.65, 55]]) == ["female"]
  assert build_and_train_svm([[1.80, 85, "male"], [1.55, 45, "female"], [1.67, 63, "female"], [1.72, 72, "male"], [1.69, 68, "female"]], [[1.75, 70]]) == ["male"]
output: def build_and_train_svm(data, to_predict):
      from sklearn import svm
      from sklearn.preprocessing import LabelEncoder
      
      # Extract features and labels from the input data
      X = [[row[0], row[1]] for row in data]
      y = [row[2] for row in data]
      
      # Encode the labels
      label_encoder = LabelEncoder()
      y_encoded = label_encoder.fit_transform(y)
      
      # Build and train the SVM model
      model = svm.SVC()
      model.fit(X, y_encoded)
      
      # Predict the labels for the new data
      predictions_encoded = model.predict(to_predict)
      
      # Decode the predicted labels
      predictions = label_encoder.inverse_transform(predictions_encoded)
      
      return predictions