class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: D = None
        self.p: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.s: G = None
        self.w: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: I = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: E = None
        self.r: D = None
        self.s: H = None
        self.y: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.s: G = None
        self.w: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: I = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: E = None
        self.r: D = None
        self.s: H = None
        self.y: E = None
        self.txt = txt

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

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