class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: E = None
        self.v: H = None
        self.p: C = None
        self.u: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: H = None
        self.z: I = None
        self.x: C = None
        self.w: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: H = None
        self.x: H = None
        self.r: F = None
        self.w: I = None
        self.t: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: C = None
        self.z: E = None
        self.x: D = None
        self.p: I = None
        self.r: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.x: B = None
        self.u: D = None
        self.p: F = None
        self.txt = txt

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

l = A("l")
d = B("d")
b = C("b")
f = D("f")
e = E("e")
k = F("k")
n = G("n")
g = H("g")
a = I("a")

l.r = e
l.x = e
l.v = g
l.p = b
l.u = a
d.u = l
d.q = g
d.z = a
d.x = b
d.w = f
b.r = e
b.p = e
b.u = l
b.x = g
b.w = n
b.t = n
b.y = f
b.z = k
f.s = b
f.w = b
f.o = e
f.u = e
f.p = d
f.q = d
f.v = k
f.z = n
f.y = a
e.o = l
e.p = g
e.x = g
e.r = k
e.w = a
e.t = f
k.y = n
k.u = d
n.s = f
n.x = f
n.r = f
n.u = b
n.z = e
n.p = a
g.w = e
g.x = d
g.u = f
g.p = k
a.q = e
assert f.v.y.u.y.z.p.q.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: E = None
        self.v: H = None
        self.p: C = None
        self.u: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: H = None
        self.z: I = None
        self.x: C = None
        self.w: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: H = None
        self.x: H = None
        self.r: F = None
        self.w: I = None
        self.t: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: C = None
        self.z: E = None
        self.x: D = None
        self.p: I = None
        self.r: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.x: B = None
        self.u: D = None
        self.p: F = None
        self.txt = txt

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

l = A("l")
d = B("d")
b = C("b")
f = D("f")
e = E("e")
k = F("k")
n = G("n")
g = H("g")
a = I("a")

l.r = e
l.x = e
l.v = g
l.p = b
l.u = a
d.u = l
d.q = g
d.z = a
d.x = b
d.w = f
b.r = e
b.p = e
b.u = l
b.x = g
b.w = n
b.t = n
b.y = f
b.z = k
f.s = b
f.w = b
f.o = e
f.u = e
f.p = d
f.q = d
f.v = k
f.z = n
f.y = a
e.o = l
e.p = g
e.x = g
e.r = k
e.w = a
e.t = f
k.y = n
k.u = d
n.s = f
n.x = f
n.r = f
n.u = b
n.z = e
n.p = a
g.w = e
g.x = d
g.u = f
g.p = k
a.q = e
assert f.v.y.u.y.z.p.q.txt == "e"