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

class B:
    def __init__(self, txt: str):
        self.s: I = None
        self.y: I = None
        self.r: G = None
        self.p: D = None
        self.q: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.o: I = None
        self.z: B = None
        self.r: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: A = None
        self.u: A = None
        self.s: G = None
        self.r: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: G = None
        self.w: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: I = None
        self.y: I = None
        self.r: G = None
        self.p: D = None
        self.q: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.o: I = None
        self.z: B = None
        self.r: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: A = None
        self.u: A = None
        self.s: G = None
        self.r: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: G = None
        self.w: B = None
        self.txt = txt

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

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