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

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.q: D = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.t: B = None
        self.v: A = None
        self.s: H = None
        self.x: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.t: I = None
        self.u: H = None
        self.s: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.w: I = None
        self.v: B = None
        self.u: H = None
        self.o: I = None
        self.s: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: D = None
        self.p: D = None
        self.t: J = None
        self.w: D = None
        self.v: B = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: A = None
        self.p: E = None
        self.o: I = None
        self.u: H = None
        self.z: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.q: D = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.t: B = None
        self.v: A = None
        self.s: H = None
        self.x: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.t: I = None
        self.u: H = None
        self.s: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.w: I = None
        self.v: B = None
        self.u: H = None
        self.o: I = None
        self.s: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: D = None
        self.p: D = None
        self.t: J = None
        self.w: D = None
        self.v: B = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: A = None
        self.p: E = None
        self.o: I = None
        self.u: H = None
        self.z: D = None
        self.txt = txt

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

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