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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: C = None
        self.o: D = None
        self.y: G = None
        self.z: A = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: G = None
        self.r: G = None
        self.o: A = None
        self.p: I = None
        self.t: D = None
        self.u: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: F = None
        self.t: D = None
        self.y: I = None
        self.p: D = None
        self.o: H = None
        self.z: I = None
        self.v: B = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.p: F = None
        self.y: E = None
        self.u: E = None
        self.w: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: C = None
        self.o: D = None
        self.y: G = None
        self.z: A = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: G = None
        self.r: G = None
        self.o: A = None
        self.p: I = None
        self.t: D = None
        self.u: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: F = None
        self.t: D = None
        self.y: I = None
        self.p: D = None
        self.o: H = None
        self.z: I = None
        self.v: B = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.p: F = None
        self.y: E = None
        self.u: E = None
        self.w: B = None
        self.txt = txt

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

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