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

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: G = None
        self.v: B = None
        self.r: G = None
        self.p: B = None
        self.s: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.w: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: H = None
        self.p: E = None
        self.q: A = None
        self.v: I = None
        self.r: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: G = None
        self.v: B = None
        self.r: G = None
        self.p: B = None
        self.s: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.w: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: H = None
        self.p: E = None
        self.q: A = None
        self.v: I = None
        self.r: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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

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

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