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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: D = None
        self.z: D = None
        self.u: F = None
        self.txt = txt

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

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

j.u = n
j.q = n
j.r = e
i.o = b
i.x = b
i.y = n
i.z = n
i.u = j
e.u = j
e.q = k
m.z = k
n.s = i
n.r = m
n.z = m
n.u = k
k.x = n
k.p = j
k.r = j
k.q = i
k.y = m
k.s = e
b.o = i
b.x = i
b.y = n
b.z = n
b.u = j
assert j.r.u.u.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.q: E = None
        self.r: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: D = None
        self.z: D = None
        self.u: F = None
        self.txt = txt

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

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

j.u = n
j.q = n
j.r = e
i.o = b
i.x = b
i.y = n
i.z = n
i.u = j
e.u = j
e.q = k
m.z = k
n.s = i
n.r = m
n.z = m
n.u = k
k.x = n
k.p = j
k.r = j
k.q = i
k.y = m
k.s = e
b.o = i
b.x = i
b.y = n
b.z = n
b.u = j
assert j.r.u.u.z.z.txt == "k"