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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: G = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: C = None
        self.p: B = None
        self.w: C = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: G = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: C = None
        self.p: B = None
        self.w: C = None
        self.txt = txt

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

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