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

class B:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: E = None
        self.q: E = None
        self.v: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: E = None
        self.v: E = None
        self.p: C = None
        self.z: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: E = None
        self.q: E = None
        self.v: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: E = None
        self.v: E = None
        self.p: C = None
        self.z: C = None
        self.txt = txt

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

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

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