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

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: C = None
        self.z: D = None
        self.u: B = None
        self.t: A = None
        self.txt = txt

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

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

g = A("g")
j = B("j")
k = C("k")
a = D("a")
l = E("l")
n = C("n")

g.x = k
g.p = j
g.u = a
j.v = k
k.x = g
k.t = g
k.w = n
k.z = a
k.u = j
a.y = g
a.r = g
l.x = j
n.x = g
n.t = g
n.w = k
n.z = a
n.u = j
assert k.z.r.x.u.v.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: B = None
        self.u: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: C = None
        self.z: D = None
        self.u: B = None
        self.t: A = None
        self.txt = txt

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

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

g = A("g")
j = B("j")
k = C("k")
a = D("a")
l = E("l")
n = C("n")

g.x = k
g.p = j
g.u = a
j.v = k
k.x = g
k.t = g
k.w = n
k.z = a
k.u = j
a.y = g
a.r = g
l.x = j
n.x = g
n.t = g
n.w = k
n.z = a
n.u = j
assert k.z.r.x.u.v.txt == "k"