class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: H = None
        self.w: J = None
        self.p: C = None
        self.u: J = None
        self.t: D = None
        self.r: D = None
        self.q: J = None
        self.s: B = None
        self.y: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.p: D = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.z: H = None
        self.q: B = None
        self.x: J = None
        self.r: H = None
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: C = None
        self.w: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: A = None
        self.z: G = None
        self.y: C = None
        self.w: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: J = None
        self.x: J = None
        self.u: C = None
        self.z: H = None
        self.s: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.p: D = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.z: H = None
        self.q: B = None
        self.x: J = None
        self.r: H = None
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: C = None
        self.w: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: A = None
        self.z: G = None
        self.y: C = None
        self.w: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: J = None
        self.x: J = None
        self.u: C = None
        self.z: H = None
        self.s: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: B = None
        self.txt = txt

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

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

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