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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: G = None
        self.w: C = None
        self.y: A = None
        self.o: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.t: H = None
        self.q: H = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: G = None
        self.w: C = None
        self.y: A = None
        self.o: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.t: H = None
        self.q: H = None
        self.txt = txt

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

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

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

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