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

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

class C:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: B = None
        self.x: C = None
        self.y: D = None
        self.z: E = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: B = None
        self.x: C = None
        self.y: D = None
        self.z: E = None
        self.txt = txt

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

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

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

b.v = i
b.x = h
m.p = j
m.v = j
m.o = h
m.r = a
i.u = j
i.x = j
i.t = m
i.y = d
i.z = g
h.y = g
h.u = d
h.r = d
h.x = i
h.v = i
g.x = j
g.y = i
g.s = d
d.y = g
d.u = h
d.r = h
d.x = i
d.v = i
a.p = i
a.v = i
a.o = h
a.r = m
j.u = i
j.x = i
j.t = a
j.y = d
j.z = g
assert i.u.x.y.r.u.y.y.txt == "i"