class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.p: F = None
        self.w: F = None
        self.o: E = None
        self.x: E = None
        self.y: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: E = None
        self.x: G = None
        self.u: C = None
        self.y: F = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: A = None
        self.u: B = None
        self.r: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.x: E = None
        self.w: G = None
        self.v: G = None
        self.t: B = None
        self.txt = txt

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

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

g.z = n
g.p = n
g.w = n
g.o = h
g.x = h
g.y = a
e.u = h
e.y = h
e.v = h
e.p = k
e.o = k
e.z = g
e.w = g
d.r = k
a.r = n
a.y = n
a.t = h
a.x = k
a.u = d
a.z = d
h.x = d
h.q = g
h.u = b
h.r = k
n.q = d
n.x = h
n.w = k
n.v = k
n.t = b
k.w = d
b.u = h
b.y = h
b.v = h
b.p = k
b.o = k
b.z = g
b.w = g
assert h.x.r.w.r.w.r.w.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.p: F = None
        self.w: F = None
        self.o: E = None
        self.x: E = None
        self.y: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: E = None
        self.x: G = None
        self.u: C = None
        self.y: F = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: A = None
        self.u: B = None
        self.r: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.x: E = None
        self.w: G = None
        self.v: G = None
        self.t: B = None
        self.txt = txt

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

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

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