class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.s: G = None
        self.u: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: J = None
        self.u: H = None
        self.o: G = None
        self.p: G = 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.w: A = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: I = None
        self.q: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: G = None
        self.u: C = None
        self.y: C = None
        self.z: B = None
        self.r: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: J = None
        self.u: H = None
        self.o: G = None
        self.p: G = 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.w: A = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: I = None
        self.q: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: G = None
        self.u: C = None
        self.y: C = None
        self.z: B = None
        self.r: E = None
        self.txt = txt

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

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

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