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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: G = None
        self.z: G = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: H = None
        self.q: H = None
        self.p: A = None
        self.x: H = None
        self.z: A = None
        self.s: D = None
        self.u: A = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: E = None
        self.v: G = None
        self.txt = txt

c = A("c")
a = B("a")
h = C("h")
f = D("f")
b = E("b")
g = F("g")
e = G("e")
n = H("n")

c.w = b
c.y = f
c.r = f
c.p = f
c.x = f
c.u = e
c.q = a
a.p = f
a.q = f
a.r = e
a.z = e
h.t = a
h.r = n
h.q = n
h.x = n
h.p = c
h.z = c
h.u = c
h.s = f
f.v = e
f.z = g
b.q = e
g.v = f
g.p = f
g.t = a
e.w = c
n.t = h
n.q = b
n.v = e
assert c.q.r.w.u.w.w.q.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: D = None
        self.u: G = None
        self.r: D = None
        self.p: D = None
        self.q: B = None
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: G = None
        self.z: G = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: H = None
        self.q: H = None
        self.p: A = None
        self.x: H = None
        self.z: A = None
        self.s: D = None
        self.u: A = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: E = None
        self.v: G = None
        self.txt = txt

c = A("c")
a = B("a")
h = C("h")
f = D("f")
b = E("b")
g = F("g")
e = G("e")
n = H("n")

c.w = b
c.y = f
c.r = f
c.p = f
c.x = f
c.u = e
c.q = a
a.p = f
a.q = f
a.r = e
a.z = e
h.t = a
h.r = n
h.q = n
h.x = n
h.p = c
h.z = c
h.u = c
h.s = f
f.v = e
f.z = g
b.q = e
g.v = f
g.p = f
g.t = a
e.w = c
n.t = h
n.q = b
n.v = e
assert c.q.r.w.u.w.w.q.txt == "e"