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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: E = None
        self.r: E = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: E = None
        self.r: E = None
        self.z: A = None
        self.txt = txt

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

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