class A:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: B = None
        self.t: D = None
        self.q: G = None
        self.r: F = None
        self.x: A = None
        self.w: C = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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