class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: A = None
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: A = None
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

e = A("e")
m = B("m")
f = C("f")
a = C("a")
h = C("h")
k = C("k")
j = A("j")
d = B("d")
b = B("b")
i = C("i")

e.y = h
e.v = j
e.u = k
m.q = d
m.x = j
m.z = e
f.t = b
a.t = b
h.t = d
k.t = b
j.y = h
j.v = e
j.u = i
d.q = m
d.x = e
d.z = e
b.q = d
b.x = j
b.z = j
i.t = d
assert b.q.q.z.y.t.q.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: A = None
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: A = None
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

e = A("e")
m = B("m")
f = C("f")
a = C("a")
h = C("h")
k = C("k")
j = A("j")
d = B("d")
b = B("b")
i = C("i")

e.y = h
e.v = j
e.u = k
m.q = d
m.x = j
m.z = e
f.t = b
a.t = b
h.t = d
k.t = b
j.y = h
j.v = e
j.u = i
d.q = m
d.x = e
d.z = e
b.q = d
b.x = j
b.z = j
i.t = d
assert b.q.q.z.y.t.q.txt == "m"