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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: C = None
        self.q: C = None
        self.t: E = None
        self.v: C = None
        self.u: C = None
        self.txt = txt

c = A("c")
j = B("j")
m = C("m")
a = D("a")
l = E("l")
k = F("k")

c.p = j
c.q = k
c.u = k
c.t = m
j.r = c
j.o = k
j.y = a
j.v = a
j.q = l
m.w = k
m.t = a
m.z = a
a.o = m
a.q = j
l.t = c
l.y = j
k.w = m
k.r = m
k.q = m
k.v = m
k.u = m
k.t = l
assert l.t.u.w.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: F = None
        self.u: F = None
        self.t: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: C = None
        self.q: C = None
        self.t: E = None
        self.v: C = None
        self.u: C = None
        self.txt = txt

c = A("c")
j = B("j")
m = C("m")
a = D("a")
l = E("l")
k = F("k")

c.p = j
c.q = k
c.u = k
c.t = m
j.r = c
j.o = k
j.y = a
j.v = a
j.q = l
m.w = k
m.t = a
m.z = a
a.o = m
a.q = j
l.t = c
l.y = j
k.w = m
k.r = m
k.q = m
k.v = m
k.u = m
k.t = l
assert l.t.u.w.txt == "m"