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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: I = None
        self.p: H = None
        self.w: H = None
        self.x: D = None
        self.u: H = None
        self.s: G = None
        self.t: E = None
        self.z: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: G = None
        self.q: I = None
        self.s: I = None
        self.w: G = None
        self.u: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.v: B = None
        self.p: B = None
        self.u: F = None
        self.z: B = None
        self.y: H = None
        self.s: H = None
        self.w: H = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: G = None
        self.v: B = None
        self.s: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: D = None
        self.u: A = None
        self.z: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: I = None
        self.p: H = None
        self.w: H = None
        self.x: D = None
        self.u: H = None
        self.s: G = None
        self.t: E = None
        self.z: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: G = None
        self.q: I = None
        self.s: I = None
        self.w: G = None
        self.u: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.v: B = None
        self.p: B = None
        self.u: F = None
        self.z: B = None
        self.y: H = None
        self.s: H = None
        self.w: H = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: G = None
        self.v: B = None
        self.s: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: D = None
        self.u: A = None
        self.z: E = None
        self.txt = txt

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

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