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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: F = None
        self.w: B = None
        self.z: C = None
        self.p: A = None
        self.o: G = None
        self.y: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: E = None
        self.v: B = None
        self.s: D = None
        self.p: F = None
        self.w: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: D = None
        self.o: B = None
        self.u: A = None
        self.txt = txt

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

c = A("c")
j = B("j")
f = C("f")
h = D("h")
n = E("n")
g = F("g")
k = G("k")
i = B("i")
e = E("e")
m = D("m")

c.w = f
j.u = m
j.x = g
j.w = i
j.z = f
j.y = f
j.p = c
j.o = k
f.s = g
f.z = n
f.y = c
h.u = i
h.y = k
h.x = n
h.z = m
n.y = m
n.w = m
n.o = e
n.v = j
n.s = h
n.p = g
g.p = k
g.y = h
g.o = i
g.u = c
k.z = m
k.o = g
i.u = m
i.x = g
i.w = j
i.z = f
i.y = f
i.p = c
i.o = k
e.y = h
e.s = h
e.o = n
e.v = i
e.p = g
e.w = m
m.u = j
m.y = k
m.x = e
m.z = h
assert k.o.o.z.y.w.z.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: F = None
        self.w: B = None
        self.z: C = None
        self.p: A = None
        self.o: G = None
        self.y: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: E = None
        self.v: B = None
        self.s: D = None
        self.p: F = None
        self.w: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: D = None
        self.o: B = None
        self.u: A = None
        self.txt = txt

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

c = A("c")
j = B("j")
f = C("f")
h = D("h")
n = E("n")
g = F("g")
k = G("k")
i = B("i")
e = E("e")
m = D("m")

c.w = f
j.u = m
j.x = g
j.w = i
j.z = f
j.y = f
j.p = c
j.o = k
f.s = g
f.z = n
f.y = c
h.u = i
h.y = k
h.x = n
h.z = m
n.y = m
n.w = m
n.o = e
n.v = j
n.s = h
n.p = g
g.p = k
g.y = h
g.o = i
g.u = c
k.z = m
k.o = g
i.u = m
i.x = g
i.w = j
i.z = f
i.y = f
i.p = c
i.o = k
e.y = h
e.s = h
e.o = n
e.v = i
e.p = g
e.w = m
m.u = j
m.y = k
m.x = e
m.z = h
assert k.o.o.z.y.w.z.o.s.txt == "h"