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

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

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.y: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: F = None
        self.w: A = None
        self.t: B = None
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.x: A = None
        self.p: G = None
        self.t: E = None
        self.y: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.r: H = None
        self.w: A = None
        self.t: A = None
        self.v: A = None
        self.o: D = None
        self.p: H = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.y: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: F = None
        self.w: A = None
        self.t: B = None
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.x: A = None
        self.p: G = None
        self.t: E = None
        self.y: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.r: H = None
        self.w: A = None
        self.t: A = None
        self.v: A = None
        self.o: D = None
        self.p: H = None
        self.txt = txt

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

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