class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.z: E = None
        self.w: E = None
        self.q: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

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

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