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

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.s: D = None
        self.w: E = None
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: G = None
        self.o: D = None
        self.y: I = None
        self.t: B = None
        self.w: F = None
        self.r: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: H = None
        self.w: B = None
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.x: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.s: D = None
        self.w: E = None
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: G = None
        self.o: D = None
        self.y: I = None
        self.t: B = None
        self.w: F = None
        self.r: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: H = None
        self.w: B = None
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.x: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

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