class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: D = None
        self.s: E = None
        self.z: E = None
        self.v: C = None
        self.r: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: F = None
        self.s: C = None
        self.z: E = None
        self.y: A = None
        self.w: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: F = None
        self.u: D = None
        self.o: A = None
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: E = None
        self.p: A = None
        self.o: D = None
        self.q: A = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: F = None
        self.s: C = None
        self.z: E = None
        self.y: A = None
        self.w: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: F = None
        self.u: D = None
        self.o: A = None
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: E = None
        self.p: A = None
        self.o: D = None
        self.q: A = None
        self.txt = txt

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

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

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

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