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

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: H = None
        self.p: J = None
        self.r: G = None
        self.s: E = None
        self.z: A = None
        self.w: B = None
        self.v: B = None
        self.t: I = None
        self.o: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.r: B = None
        self.w: J = None
        self.y: I = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: H = None
        self.z: B = None
        self.v: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: F = None
        self.p: C = None
        self.o: D = None
        self.txt = txt

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

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

f.q = j
f.t = e
f.s = e
f.v = a
f.x = g
f.z = i
f.y = d
f.p = c
g.s = d
g.p = j
g.w = a
h.u = f
c.u = h
c.q = j
c.p = d
c.r = n
c.s = i
c.o = i
c.z = f
c.w = g
c.v = g
c.t = e
i.p = h
a.v = e
a.y = e
a.r = g
a.w = d
a.s = h
n.q = f
n.t = j
n.z = g
n.v = e
j.t = g
j.y = h
e.r = a
e.p = h
e.o = c
d.p = h
assert d.p.u.q.t.txt == "
class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.t: I = None
        self.v: F = None
        self.x: B = None
        self.z: E = None
        self.y: J = None
        self.p: D = None
        self.s: I = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: H = None
        self.p: J = None
        self.r: G = None
        self.s: E = None
        self.z: A = None
        self.w: B = None
        self.v: B = None
        self.t: I = None
        self.o: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.r: B = None
        self.w: J = None
        self.y: I = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: H = None
        self.z: B = None
        self.v: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: F = None
        self.p: C = None
        self.o: D = None
        self.txt = txt

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

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

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