class A:
    def __init__(self, txt: str):
        self.p: I = None
        self.q: D = None
        self.r: I = None
        self.w: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: H = None
        self.y: A = None
        self.p: J = None
        self.r: D = None
        self.o: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.t: F = None
        self.w: C = None
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.u: D = None
        self.y: C = None
        self.w: G = None
        self.z: B = None
        self.x: E = None
        self.p: J = None
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: E = None
        self.u: D = None
        self.z: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: I = None
        self.r: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: F = None
        self.r: A = None
        self.x: G = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: H = None
        self.y: A = None
        self.p: J = None
        self.r: D = None
        self.o: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.t: F = None
        self.w: C = None
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.u: D = None
        self.y: C = None
        self.w: G = None
        self.z: B = None
        self.x: E = None
        self.p: J = None
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: E = None
        self.u: D = None
        self.z: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: I = None
        self.r: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: F = None
        self.r: A = None
        self.x: G = None
        self.txt = txt

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

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

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