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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: H = None
        self.q: G = None
        self.z: I = None
        self.p: C = None
        self.x: C = None
        self.r: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.w: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: F = None
        self.u: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.z: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: H = None
        self.q: G = None
        self.z: I = None
        self.p: C = None
        self.x: C = None
        self.r: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.w: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: F = None
        self.u: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.z: E = None
        self.txt = txt

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

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

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