class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: G = None
        self.z: I = None
        self.r: F = None
        self.q: B = None
        self.s: H = None
        self.p: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: J = None
        self.t: I = None
        self.u: J = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: I = None
        self.x: H = None
        self.y: B = None
        self.r: J = None
        self.o: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: D = None
        self.q: G = None
        self.x: H = None
        self.w: C = None
        self.y: J = None
        self.p: G = None
        self.v: D = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.x: I = None
        self.p: I = None
        self.z: H = None
        self.y: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: J = None
        self.t: I = None
        self.u: J = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: I = None
        self.x: H = None
        self.y: B = None
        self.r: J = None
        self.o: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: D = None
        self.q: G = None
        self.x: H = None
        self.w: C = None
        self.y: J = None
        self.p: G = None
        self.v: D = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.x: I = None
        self.p: I = None
        self.z: H = None
        self.y: D = None
        self.txt = txt

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

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