class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: C = None
        self.z: E = None
        self.v: F = None
        self.u: C = None
        self.p: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.p: D = None
        self.y: B = None
        self.x: A = None
        self.t: C = None
        self.txt = txt

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

a = A("a")
c = B("c")
g = C("g")
k = D("k")
l = E("l")
j = F("j")
e = G("e")

a.t = j
a.v = j
a.q = g
a.u = g
a.p = g
a.z = l
c.u = g
c.r = k
g.v = l
k.r = l
l.w = c
l.z = g
j.u = g
j.t = g
j.p = k
j.y = c
j.x = a
e.w = g
e.x = g
assert a.q.v.z.v.w.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: C = None
        self.z: E = None
        self.v: F = None
        self.u: C = None
        self.p: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.p: D = None
        self.y: B = None
        self.x: A = None
        self.t: C = None
        self.txt = txt

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

a = A("a")
c = B("c")
g = C("g")
k = D("k")
l = E("l")
j = F("j")
e = G("e")

a.t = j
a.v = j
a.q = g
a.u = g
a.p = g
a.z = l
c.u = g
c.r = k
g.v = l
k.r = l
l.w = c
l.z = g
j.u = g
j.t = g
j.p = k
j.y = c
j.x = a
e.w = g
e.x = g
assert a.q.v.z.v.w.r.r.txt == "l"