class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: E = None
        self.t: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: D = None
        self.o: E = None
        self.w: B = None
        self.z: D = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: D = None
        self.o: E = None
        self.w: B = None
        self.z: D = None
        self.txt = txt

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

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

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

h.x = l
h.r = c
h.t = c
e.s = h
e.t = c
e.o = c
e.v = n
g.p = n
g.u = k
g.z = k
g.o = c
g.w = e
k.t = g
c.z = l
c.w = l
c.r = g
c.v = h
c.y = k
l.s = h
l.t = c
l.o = c
l.v = k
n.t = g
assert k.t.o.y.t.p.t.txt == "g"