class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: C = None
        self.y: G = None
        self.r: C = None
        self.x: G = None
        self.txt = txt

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

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

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

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

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

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

k = A("k")
n = B("n")
e = C("e")
i = D("i")
f = E("f")
l = F("l")
a = G("a")
g = B("g")
j = E("j")
d = F("d")

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

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

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

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

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

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

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

k = A("k")
n = B("n")
e = C("e")
i = D("i")
f = E("f")
l = F("l")
a = G("a")
g = B("g")
j = E("j")
d = F("d")

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