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

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

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

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

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

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

j.s = l
k.u = c
k.s = j
k.y = f
f.t = l
f.p = h
l.w = h
l.o = h
l.p = f
l.s = n
l.u = j
n.u = l
n.z = j
h.t = l
h.p = f
d.u = l
d.z = j
c.u = k
c.s = j
c.y = f
g.u = l
g.z = j
assert g.u.o.p.t.p.t.w.t.p.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

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

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

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

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

j.s = l
k.u = c
k.s = j
k.y = f
f.t = l
f.p = h
l.w = h
l.o = h
l.p = f
l.s = n
l.u = j
n.u = l
n.z = j
h.t = l
h.p = f
d.u = l
d.z = j
c.u = k
c.s = j
c.y = f
g.u = l
g.z = j
assert g.u.o.p.t.p.t.w.t.p.txt == "f"