class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: A = None
        self.q: A = None
        self.p: A = None
        self.txt = txt

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

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

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

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

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

k = A("k")
d = B("d")
f = C("f")
i = D("i")
e = E("e")
g = F("g")
l = A("l")
c = E("c")
j = D("j")
a = F("a")

k.z = g
k.t = l
k.q = l
k.p = l
d.p = f
f.o = a
i.x = g
i.p = k
i.t = j
e.s = j
e.u = j
e.q = c
e.v = f
g.s = d
g.q = j
l.z = a
l.t = k
l.q = k
l.p = k
c.s = i
c.u = i
c.q = e
c.v = f
j.x = a
j.p = l
j.t = i
a.s = d
a.q = i
assert a.s.p.o.s.p.o.q.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: A = None
        self.q: A = None
        self.p: A = None
        self.txt = txt

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

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

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

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

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

k = A("k")
d = B("d")
f = C("f")
i = D("i")
e = E("e")
g = F("g")
l = A("l")
c = E("c")
j = D("j")
a = F("a")

k.z = g
k.t = l
k.q = l
k.p = l
d.p = f
f.o = a
i.x = g
i.p = k
i.t = j
e.s = j
e.u = j
e.q = c
e.v = f
g.s = d
g.q = j
l.z = a
l.t = k
l.q = k
l.p = k
c.s = i
c.u = i
c.q = e
c.v = f
j.x = a
j.p = l
j.t = i
a.s = d
a.q = i
assert a.s.p.o.s.p.o.q.txt == "i"