class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: D = None
        self.w: D = None
        self.x: D = None
        self.o: A = None
        self.s: F = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: E = None
        self.s: C = None
        self.v: A = None
        self.t: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: F = None
        self.p: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

a = A("a")
i = B("i")
j = C("j")
b = D("b")
h = E("h")
f = F("f")
n = G("n")
d = A("d")
k = D("k")
c = D("c")

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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: E = None
        self.s: C = None
        self.v: A = None
        self.t: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: F = None
        self.p: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

a = A("a")
i = B("i")
j = C("j")
b = D("b")
h = E("h")
f = F("f")
n = G("n")
d = A("d")
k = D("k")
c = D("c")

a.y = i
a.p = c
a.w = c
a.x = c
a.o = d
a.s = f
a.q = j
i.x = c
i.t = c
i.r = h
i.s = j
i.v = a
j.t = k
j.v = f
j.p = b
b.v = d
b.t = h
b.w = a
b.x = f
b.p = f
b.y = n
h.u = j
h.z = n
h.y = n
f.x = i
f.v = i
n.t = b
d.y = i
d.p = k
d.w = k
d.x = c
d.o = a
d.s = f
d.q = j
k.v = a
k.w = a
k.t = h
k.x = f
k.p = f
k.y = n
c.v = d
c.w = d
c.t = h
c.x = f
c.p = f
c.y = n
assert k.y.t.p.x.x.y.txt == "n"