class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: C = None
        self.w: C = None
        self.s: I = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: A = None
        self.t: B = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: I = None
        self.s: C = None
        self.v: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.z: D = None
        self.u: E = None
        self.v: C = None
        self.x: I = None
        self.t: C = None
        self.q: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: H = None
        self.o: H = None
        self.v: H = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: A = None
        self.t: B = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: I = None
        self.s: C = None
        self.v: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.z: D = None
        self.u: E = None
        self.v: C = None
        self.x: I = None
        self.t: C = None
        self.q: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: H = None
        self.o: H = None
        self.v: H = None
        self.txt = txt

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

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