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

class B:
    def __init__(self, txt: str):
        self.r: H = None
        self.u: F = None
        self.p: J = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: J = None
        self.z: G = None
        self.p: D = None
        self.t: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: G = None
        self.q: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: I = None
        self.q: F = None
        self.v: J = None
        self.u: G = None
        self.y: G = None
        self.z: D = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.t: F = None
        self.x: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: H = None
        self.u: F = None
        self.p: J = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: J = None
        self.z: G = None
        self.p: D = None
        self.t: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: G = None
        self.q: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: I = None
        self.q: F = None
        self.v: J = None
        self.u: G = None
        self.y: G = None
        self.z: D = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.t: F = None
        self.x: A = None
        self.txt = txt

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

a.x = d
j.r = i
j.u = d
j.p = f
n.z = i
m.q = f
m.z = j
m.t = l
c.y = f
c.z = b
c.p = m
c.t = d
d.y = b
d.p = b
d.q = a
b.t = a
i.r = l
i.q = d
i.v = f
i.u = b
i.y = b
i.z = m
l.p = c
l.x = j
l.t = j
f.t = d
f.x = a
assert l.p.t.y.t.x.y.t.x.q.txt == "a"