class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: A = None
        self.z: F = None
        self.o: F = None
        self.v: A = None
        self.u: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: E = None
        self.y: E = None
        self.w: C = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: C = None
        self.y: F = None
        self.o: C = None
        self.q: D = None
        self.txt = txt

d = A("d")
n = B("n")
b = C("b")
k = D("k")
m = E("m")
e = F("e")
c = A("c")
a = F("a")

d.t = k
d.s = c
d.v = c
d.z = e
d.o = e
d.u = m
n.q = b
n.w = b
n.t = b
n.u = m
n.y = m
b.r = e
k.y = c
m.z = n
m.o = b
e.u = b
e.r = b
e.o = b
e.y = a
e.q = k
c.t = k
c.s = d
c.v = d
c.z = a
c.o = a
c.u = m
a.u = b
a.r = b
a.o = b
a.y = e
a.q = k
assert n.u.o.r.u.r.u.r.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: A = None
        self.z: F = None
        self.o: F = None
        self.v: A = None
        self.u: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: E = None
        self.y: E = None
        self.w: C = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: C = None
        self.y: F = None
        self.o: C = None
        self.q: D = None
        self.txt = txt

d = A("d")
n = B("n")
b = C("b")
k = D("k")
m = E("m")
e = F("e")
c = A("c")
a = F("a")

d.t = k
d.s = c
d.v = c
d.z = e
d.o = e
d.u = m
n.q = b
n.w = b
n.t = b
n.u = m
n.y = m
b.r = e
k.y = c
m.z = n
m.o = b
e.u = b
e.r = b
e.o = b
e.y = a
e.q = k
c.t = k
c.s = d
c.v = d
c.z = a
c.o = a
c.u = m
a.u = b
a.r = b
a.o = b
a.y = e
a.q = k
assert n.u.o.r.u.r.u.r.o.txt == "b"