class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.p: F = None
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: F = None
        self.t: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.t: C = None
        self.z: G = None
        self.y: I = None
        self.w: I = None
        self.o: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: E = None
        self.r: D = None
        self.t: A = None
        self.x: I = None
        self.y: I = None
        self.v: I = None
        self.s: E = None
        self.z: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: F = None
        self.t: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.t: C = None
        self.z: G = None
        self.y: I = None
        self.w: I = None
        self.o: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: E = None
        self.r: D = None
        self.t: A = None
        self.x: I = None
        self.y: I = None
        self.v: I = None
        self.s: E = None
        self.z: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: A = None
        self.txt = txt

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

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

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