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

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

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

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

g.p = l
j.o = d
j.t = h
j.s = e
a.p = f
a.r = b
l.o = b
l.t = g
l.s = j
d.p = j
f.p = a
f.r = g
b.p = j
n.p = j
h.p = j
e.o = b
e.t = d
e.s = j
assert e.t.p.t.p.s.o.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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

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

g.p = l
j.o = d
j.t = h
j.s = e
a.p = f
a.r = b
l.o = b
l.t = g
l.s = j
d.p = j
f.p = a
f.r = g
b.p = j
n.p = j
h.p = j
e.o = b
e.t = d
e.s = j
assert e.t.p.t.p.s.o.p.txt == "j"