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

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

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

g = A("g")
d = B("d")
f = C("f")
n = B("n")
b = B("b")
k = A("k")
e = B("e")
a = B("a")
j = C("j")
l = A("l")

g.o = l
d.t = a
d.v = f
d.q = l
f.z = e
n.t = a
n.v = f
n.q = g
b.t = n
b.v = f
b.q = l
k.o = l
e.t = d
e.v = j
e.q = g
a.t = e
a.v = j
a.q = l
j.z = d
l.o = g
assert d.q.o.o.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

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

g = A("g")
d = B("d")
f = C("f")
n = B("n")
b = B("b")
k = A("k")
e = B("e")
a = B("a")
j = C("j")
l = A("l")

g.o = l
d.t = a
d.v = f
d.q = l
f.z = e
n.t = a
n.v = f
n.q = g
b.t = n
b.v = f
b.q = l
k.o = l
e.t = d
e.v = j
e.q = g
a.t = e
a.v = j
a.q = l
j.z = d
l.o = g
assert d.q.o.o.o.o.txt == "l"