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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: A = None
        self.x: D = None
        self.q: F = None
        self.z: D = None
        self.u: A = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: A = None
        self.x: D = None
        self.q: F = None
        self.z: D = None
        self.u: A = None
        self.txt = txt

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

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

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