class A:
    def __init__(self, txt: str):
        self.y: H = None
        self.o: H = None
        self.t: D = None
        self.r: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: H = None
        self.p: G = None
        self.u: H = None
        self.q: G = None
        self.r: E = None
        self.t: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: B = None
        self.x: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: H = None
        self.p: G = None
        self.u: H = None
        self.q: G = None
        self.r: E = None
        self.t: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: B = None
        self.x: C = None
        self.txt = txt

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

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

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