class A:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

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

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

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

g = A("g")
d = B("d")
a = C("a")
c = D("c")
f = E("f")
m = B("m")
h = C("h")
j = C("j")
l = A("l")
k = D("k")

g.w = l
d.p = k
d.v = m
d.t = c
d.s = a
a.p = h
a.z = h
a.w = f
a.u = f
a.o = g
c.v = h
c.o = d
c.x = d
f.s = a
f.q = a
f.p = d
f.w = m
f.z = c
m.p = k
m.v = d
m.t = c
m.s = a
h.p = a
h.z = a
h.w = f
h.u = f
h.o = g
j.p = a
j.w = f
j.u = f
j.z = h
j.o = g
l.w = g
k.v = a
k.o = d
k.x = m
assert l.w.w.w.w.w.w.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

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

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

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

g = A("g")
d = B("d")
a = C("a")
c = D("c")
f = E("f")
m = B("m")
h = C("h")
j = C("j")
l = A("l")
k = D("k")

g.w = l
d.p = k
d.v = m
d.t = c
d.s = a
a.p = h
a.z = h
a.w = f
a.u = f
a.o = g
c.v = h
c.o = d
c.x = d
f.s = a
f.q = a
f.p = d
f.w = m
f.z = c
m.p = k
m.v = d
m.t = c
m.s = a
h.p = a
h.z = a
h.w = f
h.u = f
h.o = g
j.p = a
j.w = f
j.u = f
j.z = h
j.o = g
l.w = g
k.v = a
k.o = d
k.x = m
assert l.w.w.w.w.w.w.w.w.txt == "l"