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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: C = None
        self.y: A = None
        self.s: H = None
        self.u: F = 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.t: G = None
        self.x: G = None
        self.r: C = None
        self.w: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: H = None
        self.q: E = None
        self.y: B = None
        self.txt = txt

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

g = A("g")
d = B("d")
k = C("k")
i = D("i")
e = E("e")
c = F("c")
a = G("a")
f = H("f")

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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: C = None
        self.y: A = None
        self.s: H = None
        self.u: F = 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.t: G = None
        self.x: G = None
        self.r: C = None
        self.w: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: H = None
        self.q: E = None
        self.y: B = None
        self.txt = txt

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

g = A("g")
d = B("d")
k = C("k")
i = D("i")
e = E("e")
c = F("c")
a = G("a")
f = H("f")

g.x = i
g.u = a
g.s = f
d.x = c
d.u = c
d.z = k
d.y = g
d.s = f
k.r = a
i.t = a
i.x = a
i.r = k
i.w = f
e.u = i
e.t = k
e.y = f
e.x = a
c.p = d
a.p = g
a.v = f
a.q = e
a.y = d
f.x = c
f.z = d
assert i.w.x.p.x.p.y.u.q.txt == "e"