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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: D = None
        self.txt = txt

j = A("j")
h = B("h")
a = C("a")
i = D("i")
n = E("n")
k = A("k")

j.o = a
j.z = a
j.p = n
j.q = i
h.v = a
a.x = i
a.q = i
a.v = n
i.y = k
i.q = k
i.p = a
i.u = n
i.v = n
n.u = i
n.o = i
k.o = a
k.z = a
k.p = n
k.q = i
assert i.p.q.v.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: C = None
        self.p: E = None
        self.q: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: D = None
        self.txt = txt

j = A("j")
h = B("h")
a = C("a")
i = D("i")
n = E("n")
k = A("k")

j.o = a
j.z = a
j.p = n
j.q = i
h.v = a
a.x = i
a.q = i
a.v = n
i.y = k
i.q = k
i.p = a
i.u = n
i.v = n
n.u = i
n.o = i
k.o = a
k.z = a
k.p = n
k.q = i
assert i.p.q.v.o.txt == "i"