class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: G = None
        self.v: F = None
        self.o: D = None
        self.w: C = None
        self.t: F = None
        self.z: E = None
        self.u: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: F = None
        self.p: H = None
        self.z: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: A = None
        self.u: A = None
        self.z: G = None
        self.w: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: A = None
        self.o: A = None
        self.r: I = None
        self.v: C = None
        self.w: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: I = None
        self.x: B = None
        self.s: C = None
        self.p: A = None
        self.z: I = None
        self.r: C = None
        self.w: C = None
        self.u: G = None
        self.o: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: F = None
        self.p: H = None
        self.z: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: A = None
        self.u: A = None
        self.z: G = None
        self.w: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: A = None
        self.o: A = None
        self.r: I = None
        self.v: C = None
        self.w: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: I = None
        self.x: B = None
        self.s: C = None
        self.p: A = None
        self.z: I = None
        self.r: C = None
        self.w: C = None
        self.u: G = None
        self.o: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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