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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.o: C = None
        self.z: C = None
        self.y: B = None
        self.v: A = None
        self.u: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.o: C = None
        self.v: A = None
        self.t: C = None
        self.txt = txt

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

m.t = b
a.r = j
a.o = h
a.u = h
a.z = k
a.y = b
a.v = m
k.o = h
l.x = m
l.u = m
j.p = b
j.y = l
j.x = m
n.r = j
n.o = k
n.v = m
n.t = h
b.r = j
b.o = h
b.z = k
b.y = a
b.v = m
b.u = e
e.o = h
h.o = k
assert j.x.t.r.x.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.o: C = None
        self.z: C = None
        self.y: B = None
        self.v: A = None
        self.u: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.o: C = None
        self.v: A = None
        self.t: C = None
        self.txt = txt

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

m.t = b
a.r = j
a.o = h
a.u = h
a.z = k
a.y = b
a.v = m
k.o = h
l.x = m
l.u = m
j.p = b
j.y = l
j.x = m
n.r = j
n.o = k
n.v = m
n.t = h
b.r = j
b.o = h
b.z = k
b.y = a
b.v = m
b.u = e
e.o = h
h.o = k
assert j.x.t.r.x.t.txt == "b"