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

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

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

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

e = A("e")
j = B("j")
a = C("a")
m = D("m")
b = B("b")
h = D("h")
l = B("l")
i = A("i")
g = C("g")

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

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

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

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

e = A("e")
j = B("j")
a = C("a")
m = D("m")
b = B("b")
h = D("h")
l = B("l")
i = A("i")
g = C("g")

e.o = b
j.p = b
j.t = h
a.x = i
m.v = h
m.w = e
m.y = e
m.u = l
b.p = j
b.t = m
h.v = m
h.w = i
h.u = j
h.y = e
l.p = b
l.t = h
i.o = j
g.x = i
assert b.p.p.t.v.y.txt == "e"