class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: C = None
        self.s: D = None
        self.t: A = None
        self.txt = txt

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

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

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

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

e = A("e")
b = B("b")
g = C("g")
l = D("l")
k = E("k")
i = C("i")
f = E("f")
a = E("a")
n = A("n")

e.q = g
e.p = i
e.s = l
e.t = n
b.t = e
b.z = g
g.w = l
g.o = l
g.p = a
g.s = i
g.q = i
l.w = a
l.y = b
l.z = n
k.u = l
i.w = l
i.o = l
i.p = a
i.s = g
i.q = g
f.u = l
a.u = l
n.q = i
n.p = g
n.s = l
n.t = e
assert k.u.y.t.p.p.u.y.t.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: C = None
        self.s: D = None
        self.t: A = None
        self.txt = txt

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

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

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

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

e = A("e")
b = B("b")
g = C("g")
l = D("l")
k = E("k")
i = C("i")
f = E("f")
a = E("a")
n = A("n")

e.q = g
e.p = i
e.s = l
e.t = n
b.t = e
b.z = g
g.w = l
g.o = l
g.p = a
g.s = i
g.q = i
l.w = a
l.y = b
l.z = n
k.u = l
i.w = l
i.o = l
i.p = a
i.s = g
i.q = g
f.u = l
a.u = l
n.q = i
n.p = g
n.s = l
n.t = e
assert k.u.y.t.p.p.u.y.t.q.txt == "g"