class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.x: C = None
        self.q: E = None
        self.u: D = None
        self.r: F = None
        self.s: F = None
        self.p: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: I = None
        self.v: H = None
        self.o: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: G = None
        self.q: E = None
        self.o: C = None
        self.w: E = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: D = None
        self.x: C = None
        self.y: D = None
        self.r: C = None
        self.t: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: E = None
        self.v: H = None
        self.t: C = None
        self.q: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: I = None
        self.v: H = None
        self.o: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: G = None
        self.q: E = None
        self.o: C = None
        self.w: E = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: D = None
        self.x: C = None
        self.y: D = None
        self.r: C = None
        self.t: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: E = None
        self.v: H = None
        self.t: C = None
        self.q: G = None
        self.txt = txt

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

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