class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: C = None
        self.w: G = None
        self.v: G = None
        self.t: C = None
        self.z: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.o: E = None
        self.z: D = None
        self.txt = txt

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

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

k = A("k")
f = B("f")
a = C("a")
m = D("m")
l = E("l")
n = F("n")
g = G("g")
e = H("e")

k.r = a
k.x = a
k.t = a
k.z = a
k.w = g
k.v = g
f.y = k
f.t = e
a.x = f
a.y = g
m.r = k
l.w = m
n.x = g
n.o = l
n.z = m
g.p = n
g.w = n
g.y = n
g.q = l
e.z = g
e.o = g
e.q = g
e.p = l
e.r = l
e.w = n
e.y = k
e.x = m
assert g.y.x.p.z.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: C = None
        self.w: G = None
        self.v: G = None
        self.t: C = None
        self.z: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.o: E = None
        self.z: D = None
        self.txt = txt

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

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

k = A("k")
f = B("f")
a = C("a")
m = D("m")
l = E("l")
n = F("n")
g = G("g")
e = H("e")

k.r = a
k.x = a
k.t = a
k.z = a
k.w = g
k.v = g
f.y = k
f.t = e
a.x = f
a.y = g
m.r = k
l.w = m
n.x = g
n.o = l
n.z = m
g.p = n
g.w = n
g.y = n
g.q = l
e.z = g
e.o = g
e.q = g
e.p = l
e.r = l
e.w = n
e.y = k
e.x = m
assert g.y.x.p.z.r.txt == "k"