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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: B = None
        self.txt = txt

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

e.u = m
e.s = m
e.z = h
e.v = f
e.q = b
m.r = b
m.v = f
h.z = b
h.u = m
h.q = e
k.q = a
k.t = e
a.q = k
a.p = j
a.r = j
a.t = d
a.o = e
d.o = m
d.p = m
j.q = k
j.p = a
j.r = a
j.t = d
j.o = e
f.q = a
f.t = e
b.z = h
b.u = m
b.q = e
assert d.o.r.q.u.r.q.q.txt == "b"