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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: G = None
        self.txt = txt

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

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

i = A("i")
d = B("d")
h = C("h")
k = D("k")
g = E("g")
e = F("e")
n = G("n")

i.q = g
i.v = g
i.t = e
i.y = d
i.w = n
i.r = n
d.z = k
h.w = d
k.q = n
k.r = g
k.z = i
k.t = i
k.s = h
k.y = d
g.o = d
g.w = n
e.v = h
e.o = n
e.s = n
e.q = d
n.y = e
assert k.z.r.y.q.z.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: F = None
        self.y: B = None
        self.w: G = None
        self.v: E = None
        self.r: G = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: G = None
        self.txt = txt

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

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

i = A("i")
d = B("d")
h = C("h")
k = D("k")
g = E("g")
e = F("e")
n = G("n")

i.q = g
i.v = g
i.t = e
i.y = d
i.w = n
i.r = n
d.z = k
h.w = d
k.q = n
k.r = g
k.z = i
k.t = i
k.s = h
k.y = d
g.o = d
g.w = n
e.v = h
e.o = n
e.s = n
e.q = d
n.y = e
assert k.z.r.y.q.z.txt == "k"