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

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: F = None
        self.t: C = None
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: I = None
        self.p: B = None
        self.o: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.t: D = None
        self.o: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: G = None
        self.p: D = None
        self.txt = txt

i = A("i")
k = B("k")
h = C("h")
e = D("e")
f = E("f")
c = F("c")
b = G("b")
l = H("l")
m = I("m")

i.w = b
i.r = k
k.v = b
k.r = c
k.t = h
k.s = f
h.u = k
h.v = l
e.x = b
e.o = i
f.s = e
f.v = m
f.p = k
f.o = i
c.r = h
c.z = i
c.w = i
b.u = l
b.t = e
b.o = k
l.u = f
l.o = c
m.z = f
m.u = b
m.p = e
assert m.u.t.o.r.s.v.z.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: F = None
        self.t: C = None
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: I = None
        self.p: B = None
        self.o: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.t: D = None
        self.o: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: G = None
        self.p: D = None
        self.txt = txt

i = A("i")
k = B("k")
h = C("h")
e = D("e")
f = E("f")
c = F("c")
b = G("b")
l = H("l")
m = I("m")

i.w = b
i.r = k
k.v = b
k.r = c
k.t = h
k.s = f
h.u = k
h.v = l
e.x = b
e.o = i
f.s = e
f.v = m
f.p = k
f.o = i
c.r = h
c.z = i
c.w = i
b.u = l
b.t = e
b.o = k
l.u = f
l.o = c
m.z = f
m.u = b
m.p = e
assert m.u.t.o.r.s.v.z.v.u.txt == "b"