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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: F = None
        self.v: C = None
        self.txt = txt

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

b = A("b")
e = B("e")
m = C("m")
k = D("k")
l = E("l")
c = F("c")
j = D("j")
f = F("f")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: F = None
        self.v: C = None
        self.txt = txt

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

b = A("b")
e = B("e")
m = C("m")
k = D("k")
l = E("l")
c = F("c")
j = D("j")
f = F("f")

b.r = k
b.o = e
b.u = l
b.s = c
e.u = j
e.o = m
e.q = k
m.q = j
k.y = b
k.x = f
k.z = c
l.w = b
l.y = f
l.v = m
c.z = e
c.o = e
c.s = m
c.p = l
c.w = l
j.y = b
j.x = c
j.z = c
f.z = e
f.o = e
f.s = m
f.p = l
f.w = l
assert c.s.q.z.o.q.txt == "k"