class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: I = None
        self.z: E = None
        self.w: E = None
        self.x: A = None
        self.v: D = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: D = None
        self.v: E = None
        self.o: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: H = None
        self.w: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: I = None
        self.z: E = None
        self.w: E = None
        self.x: A = None
        self.v: D = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: D = None
        self.v: E = None
        self.o: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: H = None
        self.w: E = None
        self.txt = txt

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

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