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

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

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: B = None
        self.v: B = None
        self.w: A = None
        self.txt = txt

i = A("i")
e = B("e")
j = C("j")
g = D("g")
h = D("h")
d = A("d")
a = C("a")

i.o = a
i.t = d
e.p = h
e.t = a
j.s = e
j.r = a
j.p = a
g.t = e
g.y = e
g.v = e
g.w = d
h.t = e
h.y = e
h.v = e
h.w = i
d.o = j
d.t = i
a.s = e
a.r = j
a.p = j
assert h.w.t.o.p.s.p.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: A = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: B = None
        self.v: B = None
        self.w: A = None
        self.txt = txt

i = A("i")
e = B("e")
j = C("j")
g = D("g")
h = D("h")
d = A("d")
a = C("a")

i.o = a
i.t = d
e.p = h
e.t = a
j.s = e
j.r = a
j.p = a
g.t = e
g.y = e
g.v = e
g.w = d
h.t = e
h.y = e
h.v = e
h.w = i
d.o = j
d.t = i
a.s = e
a.r = j
a.p = j
assert h.w.t.o.p.s.p.txt == "h"