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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: F = None
        self.o: A = None
        self.z: G = None
        self.v: C = None
        self.t: G = None
        self.w: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: F = None
        self.v: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: E = None
        self.s: A = None
        self.o: B = None
        self.r: E = None
        self.u: B = None
        self.w: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.y: C = None
        self.x: J = None
        self.q: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: J = None
        self.s: H = None
        self.u: B = None
        self.q: E = None
        self.w: H = None
        self.t: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: I = None
        self.r: B = None
        self.p: G = None
        self.z: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: F = None
        self.o: A = None
        self.z: G = None
        self.v: C = None
        self.t: G = None
        self.w: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: F = None
        self.v: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: E = None
        self.s: A = None
        self.o: B = None
        self.r: E = None
        self.u: B = None
        self.w: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.y: C = None
        self.x: J = None
        self.q: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: J = None
        self.s: H = None
        self.u: B = None
        self.q: E = None
        self.w: H = None
        self.t: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: I = None
        self.r: B = None
        self.p: G = None
        self.z: H = None
        self.txt = txt

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

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