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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.t: A = None
        self.u: A = None
        self.p: E = None
        self.o: A = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.t: A = None
        self.u: A = None
        self.p: E = None
        self.o: A = None
        self.txt = txt

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

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

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

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

m.y = k
m.q = b
m.v = b
m.z = c
m.x = g
a.v = i
a.p = i
a.t = m
a.u = m
a.o = m
k.p = h
d.r = b
d.w = g
b.q = m
b.w = m
b.r = m
b.v = i
i.q = m
i.w = m
i.r = m
i.v = b
g.y = k
g.q = b
g.v = b
g.z = c
g.x = m
c.r = i
c.w = g
f.v = i
f.t = g
f.u = m
f.o = m
f.p = b
h.v = b
h.p = b
h.t = m
h.u = m
h.o = m
assert f.p.w.q.w.q.w.y.p.v.v.txt == "i"