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

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: A = None
        self.u: E = None
        self.r: B = None
        self.v: H = None
        self.z: H = None
        self.y: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: B = None
        self.s: B = None
        self.x: E = None
        self.r: F = None
        self.p: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: B = None
        self.z: G = None
        self.u: A = None
        self.txt = txt

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

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

j.r = k
h.u = b
h.w = a
e.s = k
e.y = k
e.x = j
e.u = b
e.r = h
e.v = i
e.z = i
g.y = n
g.x = j
b.s = e
k.q = i
k.t = i
k.s = i
k.p = a
k.z = b
k.x = e
k.v = g
n.w = j
n.z = h
n.s = h
n.x = b
n.p = b
n.r = k
i.v = j
i.u = j
i.q = h
i.z = n
a.x = e
a.s = n
assert i.u.r.v.txt == "
class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: A = None
        self.u: E = None
        self.r: B = None
        self.v: H = None
        self.z: H = None
        self.y: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: B = None
        self.s: B = None
        self.x: E = None
        self.r: F = None
        self.p: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: B = None
        self.z: G = None
        self.u: A = None
        self.txt = txt

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

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

j.r = k
h.u = b
h.w = a
e.s = k
e.y = k
e.x = j
e.u = b
e.r = h
e.v = i
e.z = i
g.y = n
g.x = j
b.s = e
k.q = i
k.t = i
k.s = i
k.p = a
k.z = b
k.x = e
k.v = g
n.w = j
n.z = h
n.s = h
n.x = b
n.p = b
n.r = k
i.v = j
i.u = j
i.q = h
i.z = n
a.x = e
a.s = n
assert i.u.r.v.txt == "g"