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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: E = None
        self.r: A = None
        self.w: E = None
        self.v: A = None
        self.u: E = None
        self.o: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: G = None
        self.t: C = None
        self.u: G = None
        self.v: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: G = None
        self.s: C = None
        self.p: A = None
        self.v: A = None
        self.w: G = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: E = None
        self.r: A = None
        self.w: E = None
        self.v: A = None
        self.u: E = None
        self.o: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: G = None
        self.t: C = None
        self.u: G = None
        self.v: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: G = None
        self.s: C = None
        self.p: A = None
        self.v: A = None
        self.w: G = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

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

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