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

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

class C:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.z: G = None
        self.s: B = None
        self.v: A = None
        self.p: H = None
        self.y: I = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: G = None
        self.t: C = None
        self.txt = txt

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

n.w = j
l.x = a
l.y = e
l.q = m
l.s = m
l.t = i
l.r = n
k.t = f
m.q = e
j.q = i
j.z = a
j.s = l
j.v = n
j.p = f
j.y = e
i.u = k
i.o = a
i.r = e
i.y = n
i.w = m
a.o = m
f.v = l
e.y = a
e.t = k
assert f.v.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.z: G = None
        self.s: B = None
        self.v: A = None
        self.p: H = None
        self.y: I = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: G = None
        self.t: C = None
        self.txt = txt

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

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