class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.y: G = None
        self.t: F = None
        self.w: G = None
        self.q: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: F = None
        self.r: F = None
        self.q: D = None
        self.x: H = None
        self.o: F = None
        self.s: A = None
        self.z: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.p: H = None
        self.y: H = None
        self.u: C = None
        self.x: H = None
        self.z: B = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: F = None
        self.r: F = None
        self.q: D = None
        self.x: H = None
        self.o: F = None
        self.s: A = None
        self.z: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.p: H = None
        self.y: H = None
        self.u: C = None
        self.x: H = None
        self.z: B = None
        self.txt = txt

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

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

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

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

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