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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: A = None
        self.q: A = None
        self.u: C = None
        self.txt = txt

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

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

h = A("h")
c = B("c")
g = C("g")
l = D("l")
n = B("n")
d = B("d")
k = B("k")
i = D("i")
a = B("a")
f = C("f")

h.x = i
h.t = g
c.x = h
c.y = h
c.q = h
c.u = f
g.q = f
g.s = f
g.o = c
g.p = l
l.x = h
l.u = f
n.x = h
n.y = h
n.q = h
n.u = f
d.x = h
d.y = h
d.q = h
d.u = g
k.x = h
k.y = h
k.q = h
k.u = f
i.x = h
i.u = g
a.x = h
a.y = h
a.q = h
a.u = g
f.q = g
f.s = g
f.o = d
f.p = l
assert l.u.p.x.x.x.t.p.u.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: A = None
        self.q: A = None
        self.u: C = None
        self.txt = txt

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

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

h = A("h")
c = B("c")
g = C("g")
l = D("l")
n = B("n")
d = B("d")
k = B("k")
i = D("i")
a = B("a")
f = C("f")

h.x = i
h.t = g
c.x = h
c.y = h
c.q = h
c.u = f
g.q = f
g.s = f
g.o = c
g.p = l
l.x = h
l.u = f
n.x = h
n.y = h
n.q = h
n.u = f
d.x = h
d.y = h
d.q = h
d.u = g
k.x = h
k.y = h
k.q = h
k.u = f
i.x = h
i.u = g
a.x = h
a.y = h
a.q = h
a.u = g
f.q = g
f.s = g
f.o = d
f.p = l
assert l.u.p.x.x.x.t.p.u.txt == "f"