class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: A = None
        self.p: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: A = None
        self.p: D = None
        self.v: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: E = None
        self.t: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: A = None
        self.p: D = None
        self.v: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: E = None
        self.t: B = None
        self.txt = txt

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

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

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