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

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

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: B = None
        self.q: A = None
        self.v: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: F = None
        self.txt = txt

h = A("h")
k = B("k")
g = C("g")
d = D("d")
e = E("e")
j = F("j")
b = G("b")
i = A("i")

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: B = None
        self.q: A = None
        self.v: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: F = None
        self.txt = txt

h = A("h")
k = B("k")
g = C("g")
d = D("d")
e = E("e")
j = F("j")
b = G("b")
i = A("i")

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