class A:
    def __init__(self, txt: str):
        self.r: I = None
        self.p: F = None
        self.w: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.q: H = None
        self.t: D = None
        self.w: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: J = None
        self.t: F = None
        self.p: H = None
        self.o: G = None
        self.v: B = None
        self.z: G = None
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: A = None
        self.y: G = None
        self.x: G = None
        self.p: A = None
        self.r: H = None
        self.u: G = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.q: H = None
        self.t: D = None
        self.w: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: J = None
        self.t: F = None
        self.p: H = None
        self.o: G = None
        self.v: B = None
        self.z: G = None
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: A = None
        self.y: G = None
        self.x: G = None
        self.p: A = None
        self.r: H = None
        self.u: G = None
        self.txt = txt

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

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

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

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

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

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