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

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

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: F = None
        self.u: D = None
        self.r: D = None
        self.o: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: H = None
        self.u: B = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: H = None
        self.o: E = None
        self.r: A = None
        self.p: E = None
        self.w: F = None
        self.q: A = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: F = None
        self.u: D = None
        self.r: D = None
        self.o: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: H = None
        self.u: B = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: H = None
        self.o: E = None
        self.r: A = None
        self.p: E = None
        self.w: F = None
        self.q: A = None
        self.txt = txt

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

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