class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: A = None
        self.t: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.z: E = None
        self.v: G = None
        self.r: D = None
        self.x: A = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: A = None
        self.t: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.z: E = None
        self.v: G = None
        self.r: D = None
        self.x: A = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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