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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.o: D = None
        self.txt = txt

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

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

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