class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: B = None
        self.u: E = None
        self.q: B = None
        self.r: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: A = None
        self.v: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: F = None
        self.z: F = None
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.o: E = None
        self.z: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: B = None
        self.v: D = None
        self.txt = txt

m = A("m")
d = B("d")
i = C("i")
n = D("n")
a = E("a")
j = F("j")
g = F("g")
b = B("b")
h = E("h")
e = C("e")

m.z = d
m.t = d
m.q = d
m.u = h
m.r = j
d.x = g
d.u = m
d.v = h
i.o = m
i.x = j
i.q = d
n.y = i
n.v = g
n.z = j
n.x = e
a.x = n
a.z = n
a.o = h
j.s = i
j.w = b
j.v = n
g.s = i
g.w = d
g.v = n
b.x = j
b.u = m
b.v = a
h.x = n
h.z = n
h.o = a
e.o = m
e.x = g
e.q = d
assert a.o.x.x.o.r.s.q.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: B = None
        self.u: E = None
        self.q: B = None
        self.r: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: A = None
        self.v: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: F = None
        self.z: F = None
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.o: E = None
        self.z: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: B = None
        self.v: D = None
        self.txt = txt

m = A("m")
d = B("d")
i = C("i")
n = D("n")
a = E("a")
j = F("j")
g = F("g")
b = B("b")
h = E("h")
e = C("e")

m.z = d
m.t = d
m.q = d
m.u = h
m.r = j
d.x = g
d.u = m
d.v = h
i.o = m
i.x = j
i.q = d
n.y = i
n.v = g
n.z = j
n.x = e
a.x = n
a.z = n
a.o = h
j.s = i
j.w = b
j.v = n
g.s = i
g.w = d
g.v = n
b.x = j
b.u = m
b.v = a
h.x = n
h.z = n
h.o = a
e.o = m
e.x = g
e.q = d
assert a.o.x.x.o.r.s.q.u.z.txt == "d"