class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: G = None
        self.s: E = None
        self.u: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: C = None
        self.z: A = None
        self.y: G = None
        self.w: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: A = None
        self.w: A = None
        self.q: F = None
        self.txt = txt

m = A("m")
n = B("n")
a = C("a")
i = D("i")
b = E("b")
c = F("c")
l = G("l")
e = H("e")
j = I("j")
h = J("h")

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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: G = None
        self.s: E = None
        self.u: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: C = None
        self.z: A = None
        self.y: G = None
        self.w: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: A = None
        self.w: A = None
        self.q: F = None
        self.txt = txt

m = A("m")
n = B("n")
a = C("a")
i = D("i")
b = E("b")
c = F("c")
l = G("l")
e = H("e")
j = I("j")
h = J("h")

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