class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.y: C = None
        self.s: F = None
        self.w: D = None
        self.u: E = None
        self.v: G = None
        self.o: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: F = None
        self.x: D = None
        self.u: B = None
        self.v: E = None
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: A = None
        self.q: I = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: H = None
        self.q: G = None
        self.y: F = None
        self.z: F = None
        self.x: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: I = None
        self.u: F = None
        self.y: E = None
        self.r: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: E = None
        self.x: H = None
        self.q: G = None
        self.w: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: F = None
        self.x: D = None
        self.u: B = None
        self.v: E = None
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: A = None
        self.q: I = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: H = None
        self.q: G = None
        self.y: F = None
        self.z: F = None
        self.x: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: I = None
        self.u: F = None
        self.y: E = None
        self.r: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: E = None
        self.x: H = None
        self.q: G = None
        self.w: F = None
        self.txt = txt

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

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