class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: A = None
        self.v: E = None
        self.txt = txt

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

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

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

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

i = A("i")
g = B("g")
e = C("e")
n = D("n")
b = E("b")
m = A("m")
a = E("a")

i.s = n
i.t = m
i.v = a
g.q = b
e.p = a
n.u = m
n.s = b
n.o = a
b.u = e
b.x = i
b.y = i
b.z = n
m.s = n
m.t = i
m.v = a
a.u = e
a.x = i
a.y = m
a.z = n
assert g.q.u.p.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: A = None
        self.v: E = None
        self.txt = txt

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

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

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

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

i = A("i")
g = B("g")
e = C("e")
n = D("n")
b = E("b")
m = A("m")
a = E("a")

i.s = n
i.t = m
i.v = a
g.q = b
e.p = a
n.u = m
n.s = b
n.o = a
b.u = e
b.x = i
b.y = i
b.z = n
m.s = n
m.t = i
m.v = a
a.u = e
a.x = i
a.y = m
a.z = n
assert g.q.u.p.txt == "a"