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

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

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

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

b.p = c
b.u = c
b.r = j
b.s = j
m.u = l
m.r = l
m.q = l
m.s = l
m.o = b
e.p = b
e.o = k
c.w = m
a.s = c
j.o = c
j.z = c
j.w = l
l.u = m
l.r = m
l.q = m
l.s = m
l.o = b
k.p = b
k.o = e
d.s = c
assert l.o.u.w.txt == "m"