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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: E = None
        self.q: E = None
        self.r: A = None
        self.x: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: D = None
        self.s: F = None
        self.t: F = None
        self.txt = txt

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

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

a = A("a")
k = B("k")
j = C("j")
b = D("b")
i = E("i")
d = F("d")
c = G("c")

a.t = b
a.q = j
a.z = j
a.p = c
a.r = c
k.t = j
k.s = i
k.q = i
k.r = a
k.x = d
j.x = b
j.w = a
b.r = k
b.v = d
b.q = c
i.x = k
i.q = b
i.s = d
i.t = d
d.t = j
c.s = i
c.v = i
c.w = a
c.q = k
assert j.w.q.w.p.w.r.w.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: C = None
        self.z: C = None
        self.p: G = None
        self.r: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: E = None
        self.q: E = None
        self.r: A = None
        self.x: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: D = None
        self.s: F = None
        self.t: F = None
        self.txt = txt

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

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

a = A("a")
k = B("k")
j = C("j")
b = D("b")
i = E("i")
d = F("d")
c = G("c")

a.t = b
a.q = j
a.z = j
a.p = c
a.r = c
k.t = j
k.s = i
k.q = i
k.r = a
k.x = d
j.x = b
j.w = a
b.r = k
b.v = d
b.q = c
i.x = k
i.q = b
i.s = d
i.t = d
d.t = j
c.s = i
c.v = i
c.w = a
c.q = k
assert j.w.q.w.p.w.r.w.txt == "a"