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

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

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: D = None
        self.q: E = None
        self.r: F = None
        self.v: B = None
        self.o: A = None
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: I = None
        self.z: B = None
        self.y: E = None
        self.x: B = None
        self.q: G = None
        self.s: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: C = None
        self.o: G = None
        self.x: I = None
        self.z: H = None
        self.u: G = None
        self.t: B = None
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: E = None
        self.t: D = None
        self.u: I = None
        self.v: I = None
        self.x: D = None
        self.z: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: G = None
        self.x: G = None
        self.t: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: G = None
        self.q: D = None
        self.r: A = None
        self.z: B = None
        self.w: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: D = None
        self.q: E = None
        self.r: F = None
        self.v: B = None
        self.o: A = None
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: I = None
        self.z: B = None
        self.y: E = None
        self.x: B = None
        self.q: G = None
        self.s: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: C = None
        self.o: G = None
        self.x: I = None
        self.z: H = None
        self.u: G = None
        self.t: B = None
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: E = None
        self.t: D = None
        self.u: I = None
        self.v: I = None
        self.x: D = None
        self.z: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: G = None
        self.x: G = None
        self.t: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: G = None
        self.q: D = None
        self.r: A = None
        self.z: B = None
        self.w: E = None
        self.txt = txt

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

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