class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.u: F = None
        self.s: C = None
        self.y: E = None
        self.p: E = None
        self.w: C = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.z: A = None
        self.u: J = None
        self.s: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: G = None
        self.o: G = None
        self.v: G = None
        self.q: D = None
        self.x: G = None
        self.z: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: D = None
        self.p: C = None
        self.u: G = None
        self.v: H = None
        self.t: E = None
        self.o: I = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.z: A = None
        self.u: J = None
        self.s: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: G = None
        self.o: G = None
        self.v: G = None
        self.q: D = None
        self.x: G = None
        self.z: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: D = None
        self.p: C = None
        self.u: G = None
        self.v: H = None
        self.t: E = None
        self.o: I = None
        self.txt = txt

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

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