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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.s: C = None
        self.y: D = None
        self.u: C = None
        self.z: F = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.s: C = None
        self.y: D = None
        self.u: C = None
        self.z: F = None
        self.txt = txt

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

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

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

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