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

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

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

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

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

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

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

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

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

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

e.s = g
e.y = g
e.x = j
e.u = i
h.o = g
g.t = i
g.w = i
g.v = h
f.z = g
f.p = a
f.s = e
i.t = g
i.w = g
i.v = j
a.z = g
a.p = f
a.s = e
j.o = i
assert f.p.z.v.txt == "h"