class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.r: H = None
        self.z: I = None
        self.q: H = None
        self.w: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.x: F = None
        self.t: I = None
        self.o: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: C = None
        self.t: A = None
        self.u: A = None
        self.w: A = None
        self.x: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: B = None
        self.z: F = None
        self.t: G = None
        self.q: D = None
        self.w: C = None
        self.v: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: H = None
        self.u: B = None
        self.w: G = None
        self.z: H = None
        self.p: F = None
        self.r: C = None
        self.v: D = None
        self.y: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: A = None
        self.v: C = None
        self.z: B = None
        self.p: I = None
        self.y: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.x: F = None
        self.t: I = None
        self.o: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: C = None
        self.t: A = None
        self.u: A = None
        self.w: A = None
        self.x: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: B = None
        self.z: F = None
        self.t: G = None
        self.q: D = None
        self.w: C = None
        self.v: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: H = None
        self.u: B = None
        self.w: G = None
        self.z: H = None
        self.p: F = None
        self.r: C = None
        self.v: D = None
        self.y: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: A = None
        self.v: C = None
        self.z: B = None
        self.p: I = None
        self.y: B = None
        self.txt = txt

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

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