class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: G = None
        self.y: E = None
        self.o: C = None
        self.r: C = None
        self.u: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: C = None
        self.y: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: F = None
        self.s: A = None
        self.v: F = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: C = None
        self.y: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: F = None
        self.s: A = None
        self.v: F = None
        self.txt = txt

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

a.q = e
a.v = k
a.y = h
a.u = h
a.o = j
a.r = f
d.r = b
d.z = l
j.v = k
i.u = e
i.v = j
i.q = a
h.r = d
h.y = e
h.q = e
h.u = f
h.p = l
h.s = j
l.q = f
l.z = f
l.y = a
k.x = b
k.r = l
k.v = l
k.s = a
e.q = j
e.z = f
e.y = a
f.v = k
b.u = e
b.v = f
b.q = a
assert a.v.s.r.v.s.y.r.z.y.v.txt == "k"