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

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: F = None
        self.z: G = None
        self.x: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.x: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.p: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: I = None
        self.r: B = None
        self.z: G = None
        self.s: G = None
        self.u: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: C = None
        self.r: C = None
        self.y: E = None
        self.q: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: F = None
        self.z: G = None
        self.x: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.x: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.p: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: I = None
        self.r: B = None
        self.z: G = None
        self.s: G = None
        self.u: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: C = None
        self.r: C = None
        self.y: E = None
        self.q: B = None
        self.txt = txt

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

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