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

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

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

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

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

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

j.p = n
j.q = e
j.s = l
j.t = g
n.v = i
e.t = g
g.z = i
g.t = e
i.p = n
l.p = n
l.q = e
l.s = j
l.t = g
f.t = g
k.v = d
d.p = n
assert f.t.z.p.v.p.v.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: C = None
        self.s: A = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

j.p = n
j.q = e
j.s = l
j.t = g
n.v = i
e.t = g
g.z = i
g.t = e
i.p = n
l.p = n
l.q = e
l.s = j
l.t = g
f.t = g
k.v = d
d.p = n
assert f.t.z.p.v.p.v.txt == "i"