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

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

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: E = None
        self.s: B = None
        self.v: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: E = None
        self.p: E = None
        self.u: C = None
        self.txt = txt

l = A("l")
f = B("f")
i = C("i")
m = D("m")
h = E("h")
j = E("j")
n = A("n")
e = A("e")

l.x = i
l.s = m
l.w = m
f.u = i
f.w = i
f.z = j
f.x = e
i.w = h
i.o = h
i.x = j
m.w = f
m.s = f
m.q = h
m.v = l
h.v = i
h.u = i
h.r = j
h.p = j
j.v = i
j.u = i
j.r = h
j.p = h
n.x = i
n.s = m
n.w = m
e.x = i
e.s = m
e.w = m
assert i.o.v.x.v.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: D = None
        self.w: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: E = None
        self.s: B = None
        self.v: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: E = None
        self.p: E = None
        self.u: C = None
        self.txt = txt

l = A("l")
f = B("f")
i = C("i")
m = D("m")
h = E("h")
j = E("j")
n = A("n")
e = A("e")

l.x = i
l.s = m
l.w = m
f.u = i
f.w = i
f.z = j
f.x = e
i.w = h
i.o = h
i.x = j
m.w = f
m.s = f
m.q = h
m.v = l
h.v = i
h.u = i
h.r = j
h.p = j
j.v = i
j.u = i
j.r = h
j.p = h
n.x = i
n.s = m
n.w = m
e.x = i
e.s = m
e.w = m
assert i.o.v.x.v.o.v.txt == "i"