class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: E = None
        self.p: B = None
        self.u: G = None
        self.v: D = None
        self.s: D = None
        self.r: G = None
        self.t: E = None
        self.w: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: G = None
        self.w: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: J = None
        self.x: G = None
        self.o: E = None
        self.s: A = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: J = None
        self.s: D = None
        self.p: B = None
        self.u: E = None
        self.o: G = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: G = None
        self.w: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: J = None
        self.x: G = None
        self.o: E = None
        self.s: A = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: J = None
        self.s: D = None
        self.p: B = None
        self.u: E = None
        self.o: G = None
        self.txt = txt

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

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

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

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

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

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