class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: I = None
        self.w: F = None
        self.r: F = None
        self.q: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: E = None
        self.u: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: H = None
        self.o: C = None
        self.s: E = None
        self.t: B = None
        self.v: G = None
        self.r: B = None
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: F = None
        self.y: F = None
        self.u: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.r: G = None
        self.v: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: E = None
        self.s: B = None
        self.x: C = None
        self.w: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: E = None
        self.u: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: H = None
        self.o: C = None
        self.s: E = None
        self.t: B = None
        self.v: G = None
        self.r: B = None
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: F = None
        self.y: F = None
        self.u: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.r: G = None
        self.v: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: E = None
        self.s: B = None
        self.x: C = None
        self.w: C = None
        self.txt = txt

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

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

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