class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: G = None
        self.y: E = None
        self.z: E = None
        self.w: C = None
        self.q: I = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.q: C = None
        self.o: A = None
        self.w: B = None
        self.t: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: I = None
        self.z: B = None
        self.t: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: F = None
        self.v: H = None
        self.z: C = None
        self.q: E = None
        self.r: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: G = None
        self.o: F = None
        self.z: C = None
        self.v: D = None
        self.t: F = None
        self.r: B = None
        self.u: H = None
        self.s: D = None
        self.x: G = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.q: C = None
        self.o: A = None
        self.w: B = None
        self.t: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: I = None
        self.z: B = None
        self.t: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: F = None
        self.v: H = None
        self.z: C = None
        self.q: E = None
        self.r: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: G = None
        self.o: F = None
        self.z: C = None
        self.v: D = None
        self.t: F = None
        self.r: B = None
        self.u: H = None
        self.s: D = None
        self.x: G = None
        self.txt = txt

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

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