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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: A = None
        self.o: A = None
        self.q: D = None
        self.s: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: D = None
        self.t: D = None
        self.y: E = None
        self.txt = txt

c = A("c")
e = B("e")
n = C("n")
g = D("g")
i = E("i")
f = E("f")
k = A("k")

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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: A = None
        self.o: A = None
        self.q: D = None
        self.s: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: D = None
        self.t: D = None
        self.y: E = None
        self.txt = txt

c = A("c")
e = B("e")
n = C("n")
g = D("g")
i = E("i")
f = E("f")
k = A("k")

c.p = n
c.u = e
e.r = g
e.q = g
e.z = c
e.o = c
e.s = i
n.v = f
g.t = k
g.y = e
i.r = g
i.w = g
i.t = g
i.y = f
f.r = g
f.w = g
f.t = g
f.y = i
k.p = n
k.u = e
assert n.v.y.y.t.t.u.txt == "e"