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

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: D = None
        self.v: B = None
        self.p: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: D = None
        self.v: B = None
        self.p: B = None
        self.txt = txt

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

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