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

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

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

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

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

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

i.p = g
i.t = g
k.r = g
k.u = g
k.q = f
g.v = i
g.t = d
g.o = f
d.v = a
f.t = c
f.w = n
f.v = k
f.y = i
a.p = g
a.t = g
c.p = g
c.t = g
n.t = i
n.w = l
n.v = k
n.y = a
l.t = a
l.w = f
l.v = k
l.y = i
assert l.v.u.t.v.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: C = None
        self.txt = txt

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

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

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

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

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

i.p = g
i.t = g
k.r = g
k.u = g
k.q = f
g.v = i
g.t = d
g.o = f
d.v = a
f.t = c
f.w = n
f.v = k
f.y = i
a.p = g
a.t = g
c.p = g
c.t = g
n.t = i
n.w = l
n.v = k
n.y = a
l.t = a
l.w = f
l.v = k
l.y = i
assert l.v.u.t.v.p.txt == "g"