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

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

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

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

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

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

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

d.t = j
d.o = n
j.z = g
j.p = f
j.u = f
j.q = f
j.s = c
j.o = d
f.o = n
f.t = g
l.u = d
n.o = d
n.p = l
g.z = n
g.s = j
c.z = g
c.p = f
c.u = f
c.q = f
c.s = j
c.o = d
assert n.p.u.o.p.u.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: E = None
        self.txt = txt

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

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

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

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

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

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

d.t = j
d.o = n
j.z = g
j.p = f
j.u = f
j.q = f
j.s = c
j.o = d
f.o = n
f.t = g
l.u = d
n.o = d
n.p = l
g.z = n
g.s = j
c.z = g
c.p = f
c.u = f
c.q = f
c.s = j
c.o = d
assert n.p.u.o.p.u.o.txt == "n"