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

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: D = None
        self.z: I = None
        self.v: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.q: F = None
        self.w: G = None
        self.u: A = None
        self.y: F = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: C = None
        self.w: D = None
        self.q: C = None
        self.t: F = None
        self.u: H = None
        self.s: E = None
        self.p: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: G = None
        self.y: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: D = None
        self.z: I = None
        self.v: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.q: F = None
        self.w: G = None
        self.u: A = None
        self.y: F = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: C = None
        self.w: D = None
        self.q: C = None
        self.t: F = None
        self.u: H = None
        self.s: E = None
        self.p: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: G = None
        self.y: A = None
        self.txt = txt

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

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