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

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

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

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

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

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

i.q = k
i.r = j
n.r = m
n.w = g
n.v = i
f.s = k
k.w = f
k.q = f
k.s = g
k.u = i
k.v = m
l.v = f
l.y = e
l.w = i
l.o = i
g.w = f
g.q = f
g.s = e
g.u = i
g.v = j
e.w = f
e.q = f
e.s = k
e.u = i
e.v = j
m.r = j
m.w = k
m.v = i
j.r = n
j.w = k
j.v = i
assert n.r.r.v.q.v.r.w.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: B = None
        self.txt = txt

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

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

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

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

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

i.q = k
i.r = j
n.r = m
n.w = g
n.v = i
f.s = k
k.w = f
k.q = f
k.s = g
k.u = i
k.v = m
l.v = f
l.y = e
l.w = i
l.o = i
g.w = f
g.q = f
g.s = e
g.u = i
g.v = j
e.w = f
e.q = f
e.s = k
e.u = i
e.v = j
m.r = j
m.w = k
m.v = i
j.r = n
j.w = k
j.v = i
assert n.r.r.v.q.v.r.w.txt == "k"