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

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

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.u: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: H = None
        self.t: G = None
        self.v: G = None
        self.u: A = None
        self.q: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: A = None
        self.t: G = None
        self.q: A = None
        self.u: A = None
        self.w: E = None
        self.r: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: H = None
        self.z: G = None
        self.q: D = None
        self.t: H = None
        self.v: D = None
        self.u: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.t: E = None
        self.z: E = None
        self.p: A = None
        self.s: C = None
        self.txt = txt

g = A("g")
i = B("i")
d = C("d")
k = D("k")
h = E("h")
l = F("l")
n = G("n")
b = H("b")
f = G("f")

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

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

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.u: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: H = None
        self.t: G = None
        self.v: G = None
        self.u: A = None
        self.q: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: A = None
        self.t: G = None
        self.q: A = None
        self.u: A = None
        self.w: E = None
        self.r: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: H = None
        self.z: G = None
        self.q: D = None
        self.t: H = None
        self.v: D = None
        self.u: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.t: E = None
        self.z: E = None
        self.p: A = None
        self.s: C = None
        self.txt = txt

g = A("g")
i = B("i")
d = C("d")
k = D("k")
h = E("h")
l = F("l")
n = G("n")
b = H("b")
f = G("f")

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