class A:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: D = None
        self.u: C = None
        self.z: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: H = None
        self.x: D = None
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.p: G = None
        self.z: G = None
        self.w: F = None
        self.s: H = None
        self.v: C = None
        self.t: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: B = None
        self.v: B = None
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: C = None
        self.w: C = None
        self.u: D = None
        self.q: D = None
        self.r: D = None
        self.txt = txt

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

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

a.v = g
a.w = f
a.u = m
a.z = i
d.s = f
d.q = h
m.y = n
m.r = l
m.x = f
m.t = d
f.x = l
f.s = l
f.p = c
f.z = c
f.w = i
f.v = m
f.t = a
n.r = g
n.z = d
n.v = d
n.y = f
i.y = l
c.o = n
c.w = l
c.r = l
c.y = m
c.q = m
c.x = m
c.u = f
c.p = f
l.x = i
l.y = m
l.w = m
l.u = f
l.q = f
l.r = f
h.q = d
g.v = a
g.w = f
g.u = m
g.z = i
assert i.y.w.r.u.w.y.x.y.txt == "
class A:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: D = None
        self.u: C = None
        self.z: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: H = None
        self.x: D = None
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.p: G = None
        self.z: G = None
        self.w: F = None
        self.s: H = None
        self.v: C = None
        self.t: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: B = None
        self.v: B = None
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: C = None
        self.w: C = None
        self.u: D = None
        self.q: D = None
        self.r: D = None
        self.txt = txt

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

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

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