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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.z: C = None
        self.o: A = None
        self.x: A = None
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: G = None
        self.u: E = None
        self.r: C = None
        self.v: B = None
        self.z: B = None
        self.q: G = None
        self.s: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.z: E = None
        self.s: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: A = None
        self.v: E = None
        self.z: E = None
        self.txt = txt

c = A("c")
j = B("j")
f = C("f")
k = D("k")
l = E("l")
n = F("n")
m = G("m")
a = H("a")
i = C("i")
b = A("b")

c.w = k
c.o = n
j.x = n
j.v = i
j.t = f
j.r = k
f.w = l
k.r = j
l.s = n
l.y = n
l.z = i
l.o = c
l.x = c
n.w = l
n.u = l
n.y = m
n.q = m
n.r = f
n.v = j
n.z = j
n.s = a
m.v = k
m.z = l
m.s = n
a.o = j
a.u = c
a.v = l
a.z = l
i.w = l
b.w = k
b.o = n
assert l.z.w.y.r.w.z.w.z.w.z.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.o: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.z: C = None
        self.o: A = None
        self.x: A = None
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: G = None
        self.u: E = None
        self.r: C = None
        self.v: B = None
        self.z: B = None
        self.q: G = None
        self.s: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.z: E = None
        self.s: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: A = None
        self.v: E = None
        self.z: E = None
        self.txt = txt

c = A("c")
j = B("j")
f = C("f")
k = D("k")
l = E("l")
n = F("n")
m = G("m")
a = H("a")
i = C("i")
b = A("b")

c.w = k
c.o = n
j.x = n
j.v = i
j.t = f
j.r = k
f.w = l
k.r = j
l.s = n
l.y = n
l.z = i
l.o = c
l.x = c
n.w = l
n.u = l
n.y = m
n.q = m
n.r = f
n.v = j
n.z = j
n.s = a
m.v = k
m.z = l
m.s = n
a.o = j
a.u = c
a.v = l
a.z = l
i.w = l
b.w = k
b.o = n
assert l.z.w.y.r.w.z.w.z.w.z.txt == "i"