class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: B = None
        self.s: F = None
        self.w: C = None
        self.r: E = None
        self.p: E = None
        self.q: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: G = None
        self.q: F = None
        self.u: D = None
        self.y: C = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: F = None
        self.t: D = None
        self.u: E = None
        self.q: F = None
        self.txt = txt

k = A("k")
n = B("n")
e = C("e")
m = D("m")
d = E("d")
j = F("j")
a = G("a")

k.y = j
k.s = j
k.t = n
k.w = e
k.r = d
k.p = d
k.q = d
n.o = m
n.u = m
n.s = a
n.q = j
n.y = e
n.z = e
e.u = n
m.t = e
m.s = a
d.w = a
d.y = a
d.x = j
d.z = m
d.o = m
j.x = e
a.w = k
a.z = j
a.q = j
a.t = m
a.u = d
assert m.s.t.s.q.x.u.txt == "
class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: B = None
        self.s: F = None
        self.w: C = None
        self.r: E = None
        self.p: E = None
        self.q: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: G = None
        self.q: F = None
        self.u: D = None
        self.y: C = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: F = None
        self.t: D = None
        self.u: E = None
        self.q: F = None
        self.txt = txt

k = A("k")
n = B("n")
e = C("e")
m = D("m")
d = E("d")
j = F("j")
a = G("a")

k.y = j
k.s = j
k.t = n
k.w = e
k.r = d
k.p = d
k.q = d
n.o = m
n.u = m
n.s = a
n.q = j
n.y = e
n.z = e
e.u = n
m.t = e
m.s = a
d.w = a
d.y = a
d.x = j
d.z = m
d.o = m
j.x = e
a.w = k
a.z = j
a.q = j
a.t = m
a.u = d
assert m.s.t.s.q.x.u.txt == "n"