class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: H = None
        self.z: H = None
        self.x: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: A = None
        self.t: G = None
        self.w: G = None
        self.q: A = None
        self.y: A = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.q: C = None
        self.y: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: B = None
        self.v: E = None
        self.t: F = None
        self.s: F = None
        self.w: C = None
        self.y: F = None
        self.r: D = None
        self.txt = txt

e = A("e")
h = B("h")
n = C("n")
l = D("l")
d = E("d")
a = F("a")
c = G("c")
i = H("i")
f = B("f")

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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: H = None
        self.z: H = None
        self.x: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: A = None
        self.t: G = None
        self.w: G = None
        self.q: A = None
        self.y: A = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.q: C = None
        self.y: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: B = None
        self.v: E = None
        self.t: F = None
        self.s: F = None
        self.w: C = None
        self.y: F = None
        self.r: D = None
        self.txt = txt

e = A("e")
h = B("h")
n = C("n")
l = D("l")
d = E("d")
a = F("a")
c = G("c")
i = H("i")
f = B("f")

e.y = l
h.x = a
h.y = d
h.p = f
n.y = l
n.w = i
n.z = i
n.x = d
l.u = a
l.p = e
l.q = e
l.y = e
l.t = c
l.w = c
l.o = n
d.w = n
d.q = n
d.y = a
a.y = i
a.z = i
a.x = h
c.z = h
c.p = l
c.v = l
i.x = a
i.t = a
i.s = a
i.y = a
i.u = h
i.v = d
i.w = n
i.r = l
f.x = a
f.y = d
f.p = h
assert f.p.y.y.txt == "a"