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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.r: F = None
        self.q: G = None
        self.s: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: F = None
        self.o: B = None
        self.p: B = None
        self.q: B = None
        self.t: I = None
        self.x: H = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.r: F = None
        self.q: G = None
        self.s: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: F = None
        self.o: B = None
        self.p: B = None
        self.q: B = None
        self.t: I = None
        self.x: H = None
        self.txt = txt

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

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

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

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

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

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