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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: A = None
        self.o: B = None
        self.u: A = None
        self.s: G = None
        self.z: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.y: E = None
        self.x: G = None
        self.t: I = None
        self.w: E = None
        self.r: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: H = None
        self.o: G = None
        self.r: H = None
        self.w: G = None
        self.x: B = None
        self.y: F = None
        self.q: B = None
        self.p: G = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: A = None
        self.o: B = None
        self.u: A = None
        self.s: G = None
        self.z: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.y: E = None
        self.x: G = None
        self.t: I = None
        self.w: E = None
        self.r: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: H = None
        self.o: G = None
        self.r: H = None
        self.w: G = None
        self.x: B = None
        self.y: F = None
        self.q: B = None
        self.p: G = None
        self.txt = txt

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

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