class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: D = None
        self.z: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: G = None
        self.w: E = None
        self.q: E = None
        self.v: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: I = None
        self.v: E = None
        self.o: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: E = None
        self.p: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

m = A("m")
b = B("b")
h = C("h")
k = D("k")
a = E("a")
i = F("i")
d = G("d")
c = H("c")
n = I("n")
l = J("l")

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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: G = None
        self.w: E = None
        self.q: E = None
        self.v: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: I = None
        self.v: E = None
        self.o: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: E = None
        self.p: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

m = A("m")
b = B("b")
h = C("h")
k = D("k")
a = E("a")
i = F("i")
d = G("d")
c = H("c")
n = I("n")
l = J("l")

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