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

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

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

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

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

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

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

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

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

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

i.w = h
i.o = h
i.r = d
i.t = n
c.v = g
c.s = d
c.u = i
c.r = n
d.w = i
d.s = i
d.z = i
d.p = e
a.p = e
a.v = c
n.w = i
n.s = i
n.z = h
n.p = a
h.w = i
h.o = i
h.r = n
h.t = n
b.v = g
b.s = n
b.r = n
b.u = h
g.v = j
g.s = n
g.r = n
g.u = i
j.v = c
j.s = n
j.r = n
j.u = h
e.p = a
e.v = g
assert d.p.p.p.v.u.t.w.o.w.txt == "i"