class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: G = None
        self.r: C = None
        self.w: F = None
        self.v: B = None
        self.s: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: B = None
        self.x: G = None
        self.r: E = None
        self.p: F = None
        self.o: A = None
        self.txt = txt

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

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

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

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

a = A("a")
b = B("b")
n = C("n")
l = D("l")
k = E("k")
g = F("g")
h = G("h")
d = C("d")

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

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: B = None
        self.x: G = None
        self.r: E = None
        self.p: F = None
        self.o: A = None
        self.txt = txt

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

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

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

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

a = A("a")
b = B("b")
n = C("n")
l = D("l")
k = E("k")
g = F("g")
h = G("h")
d = C("d")

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