class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.u: E = None
        self.z: D = None
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: I = None
        self.p: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: G = None
        self.z: E = None
        self.y: G = None
        self.w: B = None
        self.r: H = None
        self.q: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: H = None
        self.s: I = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: A = None
        self.q: F = None
        self.y: C = None
        self.z: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: I = None
        self.p: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: G = None
        self.z: E = None
        self.y: G = None
        self.w: B = None
        self.r: H = None
        self.q: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: H = None
        self.s: I = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: A = None
        self.q: F = None
        self.y: C = None
        self.z: D = None
        self.txt = txt

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

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