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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: H = None
        self.r: H = None
        self.o: D = None
        self.p: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: C = None
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: E = None
        self.w: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: A = None
        self.txt = txt

h = A("h")
j = B("j")
g = C("g")
k = D("k")
d = E("d")
m = F("m")
i = G("i")
f = H("f")
c = B("c")
l = B("l")

h.o = g
h.u = l
h.z = d
h.w = i
j.w = h
j.x = f
j.r = f
j.o = k
j.p = i
g.y = m
g.o = k
k.y = g
k.w = g
k.t = c
k.r = m
d.s = j
m.q = i
m.z = g
m.o = j
i.y = d
i.z = d
i.w = k
f.o = l
f.x = h
c.w = h
c.x = f
c.r = f
c.o = k
c.p = i
l.w = h
l.x = f
l.r = f
l.o = k
l.p = i
assert l.o.r.q.w.r.z.y.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: B = None
        self.z: E = None
        self.w: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: H = None
        self.r: H = None
        self.o: D = None
        self.p: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: C = None
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: E = None
        self.w: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: A = None
        self.txt = txt

h = A("h")
j = B("j")
g = C("g")
k = D("k")
d = E("d")
m = F("m")
i = G("i")
f = H("f")
c = B("c")
l = B("l")

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