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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: A = None
        self.q: C = None
        self.r: B = None
        self.w: F = None
        self.t: H = None
        self.s: C = None
        self.o: H = None
        self.u: H = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: A = None
        self.r: A = None
        self.w: H = None
        self.v: G = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: A = None
        self.q: C = None
        self.r: B = None
        self.w: F = None
        self.t: H = None
        self.s: C = None
        self.o: H = None
        self.u: H = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: A = None
        self.r: A = None
        self.w: H = None
        self.v: G = None
        self.txt = txt

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

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