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

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: B = None
        self.w: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: B = None
        self.u: C = None
        self.q: E = None
        self.z: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: C = None
        self.u: D = None
        self.s: D = None
        self.w: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: C = None
        self.x: G = None
        self.r: E = None
        self.u: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: H = None
        self.x: A = None
        self.w: C = None
        self.z: A = None
        self.u: G = None
        self.y: G = None
        self.p: C = None
        self.s: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: B = None
        self.w: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: B = None
        self.u: C = None
        self.q: E = None
        self.z: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: C = None
        self.u: D = None
        self.s: D = None
        self.w: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: C = None
        self.x: G = None
        self.r: E = None
        self.u: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: H = None
        self.x: A = None
        self.w: C = None
        self.z: A = None
        self.u: G = None
        self.y: G = None
        self.p: C = None
        self.s: G = None
        self.txt = txt

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

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