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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.x: A = None
        self.y: E = None
        self.o: G = None
        self.w: A = None
        self.z: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: C = None
        self.s: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.x: A = None
        self.y: E = None
        self.o: G = None
        self.w: A = None
        self.z: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: C = None
        self.s: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

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