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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: C = None
        self.z: C = None
        self.txt = txt

k = A("k")
j = B("j")
l = C("l")
m = D("m")
f = E("f")
g = F("g")
d = F("d")
n = D("n")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: C = None
        self.z: C = None
        self.txt = txt

k = A("k")
j = B("j")
l = C("l")
m = D("m")
f = E("f")
g = F("g")
d = F("d")
n = D("n")

k.p = d
k.r = l
k.u = l
k.q = j
k.z = f
j.r = n
l.v = k
l.o = f
l.t = j
m.z = f
m.u = f
m.o = l
f.y = m
f.w = j
f.q = j
f.r = k
g.u = l
g.q = l
g.z = l
d.u = l
d.q = l
d.z = l
n.z = f
n.u = f
n.o = l
assert m.o.t.r.txt == "n"