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

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

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: A = None
        self.s: G = None
        self.z: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

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

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

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

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

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

g.u = d
g.y = m
g.z = k
m.w = d
m.y = l
m.x = l
m.r = h
m.o = h
m.s = h
m.t = f
m.v = f
m.u = n
n.r = k
h.w = e
h.z = e
h.t = i
h.s = f
k.v = d
e.x = m
e.u = m
e.s = f
e.r = l
e.v = h
e.p = n
f.w = d
d.x = n
d.v = n
d.r = k
d.y = e
d.t = h
d.o = m
d.w = f
l.y = d
l.u = n
i.u = d
i.y = m
i.z = k
assert n.r.v.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.u: H = None
        self.y: B = None
        self.z: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: A = None
        self.s: G = None
        self.z: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

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

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

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

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

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

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