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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: D = None
        self.p: A = None
        self.t: B = None
        self.txt = txt

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

k.q = b
k.v = j
e.x = b
e.v = k
e.t = k
m.v = g
m.y = b
b.z = m
d.t = j
d.y = j
d.w = f
g.r = e
f.z = j
f.v = b
f.p = k
f.t = e
l.z = j
l.v = b
l.p = k
l.t = e
j.t = d
j.y = d
j.w = a
a.z = j
a.v = b
a.p = k
a.t = e
assert k.q.z.v.r.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: E = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: D = None
        self.p: A = None
        self.t: B = None
        self.txt = txt

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

k.q = b
k.v = j
e.x = b
e.v = k
e.t = k
m.v = g
m.y = b
b.z = m
d.t = j
d.y = j
d.w = f
g.r = e
f.z = j
f.v = b
f.p = k
f.t = e
l.z = j
l.v = b
l.p = k
l.t = e
j.t = d
j.y = d
j.w = a
a.z = j
a.v = b
a.p = k
a.t = e
assert k.q.z.v.r.txt == "e"