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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: E = None
        self.y: F = None
        self.z: C = None
        self.x: C = None
        self.p: C = None
        self.u: A = None
        self.r: E = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: E = None
        self.y: F = None
        self.z: C = None
        self.x: C = None
        self.p: C = None
        self.u: A = None
        self.r: E = None
        self.txt = txt

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

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

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

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