class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: B = None
        self.y: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: B = None
        self.z: E = None
        self.p: D = None
        self.s: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.z: E = None
        self.p: D = None
        self.w: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: B = None
        self.z: E = None
        self.p: D = None
        self.s: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.z: E = None
        self.p: D = None
        self.w: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

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