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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: D = None
        self.v: C = None
        self.u: E = None
        self.y: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: E = None
        self.s: B = None
        self.t: D = None
        self.txt = txt

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

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

n = A("n")
h = B("h")
e = C("e")
l = D("l")
g = E("g")

n.y = e
n.v = e
n.t = e
n.o = g
h.q = l
h.z = l
h.y = l
h.v = e
h.u = g
e.u = n
e.r = g
e.s = h
e.t = l
l.p = g
g.r = l
assert n.o.r.p.r.p.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: C = None
        self.o: E = None
        self.t: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: D = None
        self.v: C = None
        self.u: E = None
        self.y: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: E = None
        self.s: B = None
        self.t: D = None
        self.txt = txt

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

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

n = A("n")
h = B("h")
e = C("e")
l = D("l")
g = E("g")

n.y = e
n.v = e
n.t = e
n.o = g
h.q = l
h.z = l
h.y = l
h.v = e
h.u = g
e.u = n
e.r = g
e.s = h
e.t = l
l.p = g
g.r = l
assert n.o.r.p.r.p.txt == "g"