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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: E = None
        self.u: E = None
        self.w: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: A = None
        self.o: E = None
        self.w: C = None
        self.x: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: B = None
        self.txt = txt

a = A("a")
b = B("b")
m = C("m")
h = D("h")
i = E("i")
c = B("c")
l = C("l")
j = D("j")

a.o = l
a.s = l
b.r = i
b.t = i
b.u = i
b.w = h
m.z = c
m.v = a
m.o = i
m.x = i
m.w = l
h.y = a
h.u = m
i.x = b
i.r = c
c.r = i
c.t = i
c.u = i
c.w = h
l.z = b
l.v = a
l.o = i
l.x = i
l.w = m
j.y = a
j.u = m
assert i.x.u.x.t.x.w.u.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: E = None
        self.u: E = None
        self.w: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: A = None
        self.o: E = None
        self.w: C = None
        self.x: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: B = None
        self.txt = txt

a = A("a")
b = B("b")
m = C("m")
h = D("h")
i = E("i")
c = B("c")
l = C("l")
j = D("j")

a.o = l
a.s = l
b.r = i
b.t = i
b.u = i
b.w = h
m.z = c
m.v = a
m.o = i
m.x = i
m.w = l
h.y = a
h.u = m
i.x = b
i.r = c
c.r = i
c.t = i
c.u = i
c.w = h
l.z = b
l.v = a
l.o = i
l.x = i
l.w = m
j.y = a
j.u = m
assert i.x.u.x.t.x.w.u.o.txt == "i"