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

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: G = None
        self.r: H = None
        self.p: H = None
        self.u: A = None
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.r: E = None
        self.p: J = None
        self.t: C = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.z: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: G = None
        self.o: A = None
        self.v: I = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: G = None
        self.r: H = None
        self.p: H = None
        self.u: A = None
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.r: E = None
        self.p: J = None
        self.t: C = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.z: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: G = None
        self.o: A = None
        self.v: I = None
        self.txt = txt

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

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