class A:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: B = None
        self.s: A = None
        self.z: A = None
        self.v: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: B = None
        self.y: E = None
        self.p: B = 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.p: C = None
        self.q: C = None
        self.txt = txt

n = A("n")
k = B("k")
e = C("e")
b = D("b")
j = E("j")
g = C("g")
l = C("l")
f = B("f")
d = A("d")

n.y = d
n.s = d
n.z = d
n.v = d
n.w = f
k.t = n
k.r = j
e.v = j
e.y = j
e.z = f
e.p = f
b.t = g
j.p = g
j.q = l
g.v = j
g.y = j
g.z = k
g.p = f
l.v = j
l.y = j
l.z = k
l.p = f
f.t = n
f.r = j
d.y = n
d.s = n
d.z = n
d.v = n
d.w = k
assert g.z.t.y.w.t.w.r.q.txt == "
class A:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: B = None
        self.s: A = None
        self.z: A = None
        self.v: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: B = None
        self.y: E = None
        self.p: B = 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.p: C = None
        self.q: C = None
        self.txt = txt

n = A("n")
k = B("k")
e = C("e")
b = D("b")
j = E("j")
g = C("g")
l = C("l")
f = B("f")
d = A("d")

n.y = d
n.s = d
n.z = d
n.v = d
n.w = f
k.t = n
k.r = j
e.v = j
e.y = j
e.z = f
e.p = f
b.t = g
j.p = g
j.q = l
g.v = j
g.y = j
g.z = k
g.p = f
l.v = j
l.y = j
l.z = k
l.p = f
f.t = n
f.r = j
d.y = n
d.s = n
d.z = n
d.v = n
d.w = k
assert g.z.t.y.w.t.w.r.q.txt == "l"