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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: D = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: D = None
        self.txt = txt

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

a.w = j
g.z = e
g.v = j
g.u = l
g.r = f
g.t = i
i.u = a
i.s = h
i.v = l
i.t = f
h.o = i
h.r = f
b.x = d
b.v = h
f.z = h
f.v = a
f.u = i
f.t = i
f.r = g
l.u = a
l.s = h
l.v = i
l.t = f
e.o = i
e.r = f
j.w = a
d.x = b
d.v = h
assert d.x.v.o.t.v.w.w.w.txt == "j"