class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: H = None
        self.v: G = None
        self.p: E = None
        self.o: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.s: F = None
        self.y: G = None
        self.q: H = None
        self.v: A = None
        self.t: B = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: B = None
        self.txt = txt

b = A("b")
a = B("a")
f = C("f")
h = D("h")
g = E("g")
l = F("l")
i = G("i")
m = H("m")

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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: H = None
        self.v: G = None
        self.p: E = None
        self.o: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.s: F = None
        self.y: G = None
        self.q: H = None
        self.v: A = None
        self.t: B = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: B = None
        self.txt = txt

b = A("b")
a = B("a")
f = C("f")
h = D("h")
g = E("g")
l = F("l")
i = G("i")
m = H("m")

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